本文整理汇总了Python中pyjamas.Window.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Python Window.setTitle方法的具体用法?Python Window.setTitle怎么用?Python Window.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.Window
的用法示例。
在下文中一共展示了Window.setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onTitlesChanged
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import setTitle [as 别名]
def onTitlesChanged(self, titles):
browser_title = ''
for title in reversed(titles):
browser_title += title + ' - '
browser_title = browser_title[:-3]
Window.setTitle(browser_title)
示例2: setPage
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import setTitle [as 别名]
def setPage(self, ref):
htp = self.pages[ref]
if htp == self.current_page:
return
Window.setTitle(htp.title)
if self.current_page:
self.dock.remove(self.current_page)
self.dock.add(htp, DockPanel.CENTER)
self.current_page = htp
示例3: process_track_info
# 需要导入模块: from pyjamas import Window [as 别名]
# 或者: from pyjamas.Window import setTitle [as 别名]
def process_track_info(self,text):
#explode the text at ::
#%a::%t::%l::%d::%R::%s::%v::%r
data = text.split("::")
artist = data[0]
track = data[1]
album = data[2]
duration = data[3]
played = int(duration)-int(data[4])
percent = int( played/int(duration)*100 )
self.artistLabel.setText( artist )
self.trackLabel.setText( track )
self.albumLabel.setText( album )
#format time
t = "%s : %d %d" % (duration,played,percent)
self.timeLabel.setText(data[7])
#update the timebarwidth
self.timebarPanel.setWidth("%d%" % (percent) )
#set the station
self.stationLabel.setText(data[5])
#display the volume
self.volumeLabel.setText("Volume: "+data[6])
Window.setTitle(self.title+": "+artist+" - "+track)