本文整理汇总了Python中Tkinter.Tk.iconname方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.iconname方法的具体用法?Python Tk.iconname怎么用?Python Tk.iconname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Tk
的用法示例。
在下文中一共展示了Tk.iconname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PiPresents
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconname [as 别名]
#.........这里部分代码省略.........
else:
self.mon.err(self,"showlist not found at "+self.showlist_file)
self.end('error',"showlist not found at "+self.showlist_file)
# check profile and Pi Presents issues are compatible
if self.showlist.profile_version() != self.pipresents_version():
self.mon.err(self,"Version of showlist " + self.showlist.profile_version_string + " is not same as Pi Presents")
self.end('error',"Version of showlist " + self.showlist.profile_version_string + " is not same as Pi Presents")
# get the 'start' show from the showlist
index = self.showlist.index_of_start_show()
if index >=0:
self.showlist.select(index)
self.starter_show=self.showlist.selected_show()
else:
self.mon.err(self,"Show [start] not found in showlist")
self.end('error',"Show [start] not found in showlist")
# ********************
# SET UP THE GUI
# ********************
# turn off the screenblanking and saver
if self.options['noblank'] is True:
call(["xset","s", "off"])
call(["xset","s", "-dpms"])
self.root=Tk()
self.title='Pi Presents - '+ self.pp_profile
self.icon_text= 'Pi Presents'
self.root.title(self.title)
self.root.iconname(self.icon_text)
self.root.config(bg=self.starter_show['background-colour'])
self.mon.log(self, 'monitor screen dimensions are ' + str(self.root.winfo_screenwidth()) + ' x ' + str(self.root.winfo_screenheight()) + ' pixels')
if self.options['screensize'] =='':
self.screen_width = self.root.winfo_screenwidth()
self.screen_height = self.root.winfo_screenheight()
else:
reason,message,self.screen_width,self.screen_height=self.parse_screen(self.options['screensize'])
if reason =='error':
self.mon.err(self,message)
self.end('error',message)
self.mon.log(self, 'forced screen dimensions (--screensize) are ' + str(self.screen_width) + ' x ' + str(self.screen_height) + ' pixels')
# set window dimensions and decorations
if self.options['fullscreen'] is False:
self.window_width=int(self.root.winfo_screenwidth()*self.nonfull_window_width)
self.window_height=int(self.root.winfo_screenheight()*self.nonfull_window_height)
self.window_x=self.nonfull_window_x
self.window_y=self.nonfull_window_y
self.root.geometry("%dx%d%+d%+d" % (self.window_width,self.window_height,self.window_x,self.window_y))
else:
self.window_width=self.screen_width
self.window_height=self.screen_height
self.root.attributes('-fullscreen', True)
os.system('unclutter &')
self.window_x=0
self.window_y=0
self.root.geometry("%dx%d%+d%+d" % (self.window_width,self.window_height,self.window_x,self.window_y))
self.root.attributes('-zoomed','1')
# canvas cover the whole screen whatever the size of the window.
示例2: PiPresents
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import iconname [as 别名]
#.........这里部分代码省略.........
self.end('error','showlist not found')
# check profile and Pi Presents issues are compatible
if float(self.showlist.sissue()) != float(self.pipresents_issue):
self.mon.err(self,"Version of profile " + self.showlist.sissue() + " is not same as Pi Presents, must exit")
self.end('error','wrong version of profile')
# get the 'start' show from the showlist
index = self.showlist.index_of_show('start')
if index >=0:
self.showlist.select(index)
self.starter_show=self.showlist.selected_show()
else:
self.mon.err(self,"Show [start] not found in showlist")
self.end('error','start show not found')
if self.starter_show['start-show']=='':
self.mon.warn(self,"No Start Shows in Start Show")
# ********************
# SET UP THE GUI
# ********************
# turn off the screenblanking and saver
if self.options['noblank'] is True:
call(["xset","s", "off"])
call(["xset","s", "-dpms"])
self.root=Tk()
self.title='Pi Presents - '+ self.pp_profile
self.icon_text= 'Pi Presents'
self.root.title(self.title)
self.root.iconname(self.icon_text)
self.root.config(bg=self.pp_background)
self.mon.log(self, 'native screen dimensions are ' + str(self.root.winfo_screenwidth()) + ' x ' + str(self.root.winfo_screenheight()) + ' pixcels')
if self.options['screensize'] =='':
self.screen_width = self.root.winfo_screenwidth()
self.screen_height = self.root.winfo_screenheight()
else:
reason,message,self.screen_width,self.screen_height=self.parse_screen(self.options['screensize'])
if reason =='error':
self.mon.err(self,message)
self.end('error',message)
self.mon.log(self, 'commanded screen dimensions are ' + str(self.screen_width) + ' x ' + str(self.screen_height) + ' pixcels')
# set window dimensions and decorations
if self.options['fullscreen'] is False:
self.window_width=int(self.root.winfo_screenwidth()*self.nonfull_window_width)
self.window_height=int(self.root.winfo_screenheight()*self.nonfull_window_height)
self.window_x=self.nonfull_window_x
self.window_y=self.nonfull_window_y
self.root.geometry("%dx%d%+d%+d" % (self.window_width,self.window_height,self.window_x,self.window_y))
else:
self.window_width=self.screen_width
self.window_height=self.screen_height
self.root.attributes('-fullscreen', True)
os.system('unclutter 1>&- 2>&- &') # Suppress 'someone created a subwindow' complaints from unclutter
self.window_x=0
self.window_y=0
self.root.geometry("%dx%d%+d%+d" % (self.window_width,self.window_height,self.window_x,self.window_y))
self.root.attributes('-zoomed','1')
# canvs cover the whole screen whatever the size of the window.