本文整理汇总了Python中tkinter.ttk.Label.update方法的典型用法代码示例。如果您正苦于以下问题:Python Label.update方法的具体用法?Python Label.update怎么用?Python Label.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.ttk.Label
的用法示例。
在下文中一共展示了Label.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HTMLWindow
# 需要导入模块: from tkinter.ttk import Label [as 别名]
# 或者: from tkinter.ttk.Label import update [as 别名]
#.........这里部分代码省略.........
self.statusBar = Frame( self, cursor='hand2', relief=tk.RAISED, style='HTMLStatusBar.TFrame' )
self.statusTextLabel = Label( self.statusBar, relief=tk.SUNKEN,
textvariable=self._statusTextVar, style='StatusBar.TLabel' )
#, font=('arial',16,tk.NORMAL) )
self.statusTextLabel.pack( side=tk.LEFT, fill=tk.X )
# style='Halt.TButton',
self.forwardButton = Button( self.statusBar, text='Forward', command=self.doGoForward )
self.forwardButton.pack( side=tk.RIGHT, padx=2, pady=2 )
self.backButton = Button( self.statusBar, text='Back', command=self.doGoBackward )
self.backButton.pack( side=tk.RIGHT, padx=2, pady=2 )
self.statusBar.pack( side=tk.BOTTOM, fill=tk.X )
#self.setReadyStatus()
self.setStatus() # Clear it
# end of HTMLWindow.createStatusBar
def setStatus( self, newStatusText='' ):
"""
Set (or clear) the status bar text.
"""
if BibleOrgSysGlobals.debugFlag and debuggingThisModule: print( exp("setStatus( {} )").format( repr(newStatusText) ) )
#print( "SB is", repr( self._statusTextVar.get() ) )
if newStatusText != self._statusTextVar.get(): # it's changed
#self.statusBarTextWidget['state'] = tk.NORMAL
#self.statusBarTextWidget.delete( '1.0', tk.END )
#if newStatusText:
#self.statusBarTextWidget.insert( '1.0', newStatusText )
#self.statusBarTextWidget['state'] = tk.DISABLED # Don't allow editing
#self.statusText = newStatusText
self._statusTextVar.set( newStatusText )
if self._showStatusBarVar.get(): self.statusTextLabel.update()
# end of HTMLWindow.setStatus
#def setWaitStatus( self, newStatusText ):
#"""
#Set the status bar text and change the cursor to the wait/hourglass cursor.
#"""
#if BibleOrgSysGlobals.debugFlag and debuggingThisModule:
#print( exp("setWaitStatus( {} )").format( repr(newStatusText) ) )
##self.rootWindow.config( cursor='watch' ) # 'wait' can only be used on Windows
#self.setStatus( newStatusText )
#self.update()
## end of HTMLWindow.setWaitStatus
def setReadyStatus( self ):
"""
Sets the status line to "Ready"
and sets the cursor to the normal cursor.
"""
self.setStatus( _("Ready") )
#self.config( cursor='' )
# end of HTMLWindow.setReadyStatus
def doToggleStatusBar( self ):
"""
Display or hide the status bar.
"""
if BibleOrgSysGlobals.debugFlag and debuggingThisModule: print( exp("doToggleStatusBar()") )
if self._showStatusBarVar.get():
self.createStatusBar()
else:
self.statusBar.destroy()
# end of HTMLWindow.doToggleStatusBar