当前位置: 首页>>代码示例>>Python>>正文


Python SimplePanel.setID方法代码示例

本文整理汇总了Python中pyjamas.ui.SimplePanel.SimplePanel.setID方法的典型用法代码示例。如果您正苦于以下问题:Python SimplePanel.setID方法的具体用法?Python SimplePanel.setID怎么用?Python SimplePanel.setID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.SimplePanel.SimplePanel的用法示例。


在下文中一共展示了SimplePanel.setID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas.ui.SimplePanel import SimplePanel [as 别名]
# 或者: from pyjamas.ui.SimplePanel.SimplePanel import setID [as 别名]
	def __init__(self):
		#set some vars
		self.title = "last.fm"

		#this is where we build the ui
		self.statusPanel = VerticalPanel()
		self.statusPanel.setID('status_panel')

		#make a few Labels to hold station, artist, track, album info
		self.stationLabel = Label()
		self.artistLabel = Label()
		self.trackLabel = Label()
		self.albumLabel = Label()
		self.timeLabel = Label()
		self.infoTable = FlexTable()
		i=0
		self.stationLabel = Label()
		self.infoTable.setWidget(i,0,Label("Station:") )
		self.infoTable.setWidget(i,1,self.stationLabel)
		i+=1
		self.infoTable.setWidget(i,0,Label("Artist:") )
		self.infoTable.setWidget(i,1,self.artistLabel)
		i+=1
		self.infoTable.setWidget(i,0,Label("Track:") )
		self.infoTable.setWidget(i,1,self.trackLabel)
		i+=1
		self.infoTable.setWidget(i,0,Label("Album:") )
		self.infoTable.setWidget(i,1,self.albumLabel)
		
		self.statusPanel.add(self.infoTable)
		self.statusPanel.add(self.timeLabel)
		#make the time bar
		timebarWrapperPanel = SimplePanel()
		timebarWrapperPanel.setID("timebar_wrapper")
		#timebarWrapperPanel.setStyleName('timebar_wrapper')
		self.timebarPanel = SimplePanel()
		self.timebarPanel.setID("timebar")
		#self.timebarPanel.setStyleName('timebar')
		timebarWrapperPanel.add(self.timebarPanel)
		self.statusPanel.add(timebarWrapperPanel)
		#make some shit for buttons
		self.buttonHPanel = HorizontalPanel()
		self.skipButton = Button("Skip", self.clicked_skip )
		self.buttonHPanel.add(self.skipButton)
		loveButton = Button("Love", self.clicked_love )
		self.buttonHPanel.add(loveButton)
		pauseButton = Button("Pause", self.clicked_pause )
		self.buttonHPanel.add(pauseButton)
		banButton = Button("Ban", self.clicked_ban )
		self.buttonHPanel.add(banButton)

		#control the volume
		self.volumePanel = HorizontalPanel()
		self.volumeLabel = Label("Volume:")
		self.volumePanel.add(self.volumeLabel)
		volupButton = Button("+", self.clicked_volume_up, 5)
		self.volumePanel.add(volupButton)
		voldownButton = Button("-", self.clicked_volume_down, 5)
		self.volumePanel.add(voldownButton)
		
		#make buttons and shit to create a new station
		self.setStationHPanel = HorizontalPanel()
		self.setStationTypeListBox = ListBox()
		self.setStationTypeListBox.setVisibleItemCount(0)

		self.setStationTypeListBox.addItem("Similar Artists", "artist/%s/similarartists")
		self.setStationTypeListBox.addItem("Top Fans", "artist/%s/fans")
		self.setStationTypeListBox.addItem("Library", "user/%s/library")
		self.setStationTypeListBox.addItem("Mix", "user/%s/mix")
		self.setStationTypeListBox.addItem("Recommended", "user/%s/recommended")
		self.setStationTypeListBox.addItem("Neighbours", "user/%s/neighbours")
		self.setStationTypeListBox.addItem("Global Tag", "globaltags/%s")

		self.setStationHPanel.add(self.setStationTypeListBox)
		self.setStationTextBox = TextBox()
		self.setStationTextBox.setVisibleLength(10)
		self.setStationTextBox.setMaxLength(50)
		self.setStationHPanel.add(self.setStationTextBox)
		self.setStationButton = Button("Play", self.clicked_set_station)
		self.setStationHPanel.add(self.setStationButton)

		#make an error place to display data
		self.infoHTML = HTML()
		RootPanel().add(self.statusPanel)
		RootPanel().add(self.buttonHPanel)
		RootPanel().add(self.volumePanel)
		RootPanel().add(self.setStationHPanel)
		RootPanel().add(self.infoHTML)
开发者ID:christophgysin,项目名称:PyWebShellFM,代码行数:90,代码来源:interface.py


注:本文中的pyjamas.ui.SimplePanel.SimplePanel.setID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。