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


Python Button.setID方法代码示例

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


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

示例1: htmlElements

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
	def htmlElements(self, addList = None):
		if not self._htmlElements:
			h = HTML("<h1>Run data</h1>", StyleName='font-s07em')
			p = HTML('<p>Enter <em>weighed</em> data to get information, through the neural network...</p>')
			b=Button('addField', self, StyleName='link')
			b.setID(ADD_FIELD_BUTTON)

			f = FormPanel()
			_f = self.fieldPanel([self.getWidgetObj(),0,0])
			f.add(_f)
			"""
			t = TextArea(StyleName='page-textarea')
			s=Button('submit', self, StyleName='link')
			s.setID('submitButton')
			"""
			self._htmlElements = [['h', h], ['p', p], ['b', b], ['f', f]]
			for i in range(len(self._htmlElements)):
 				RootPanel().add(self._htmlElements[i][1])

		if addList:
			self._htmlElements+=addList
			for i in range(len(self._htmlElements)):
 				RootPanel().add(addList[i][1])

		return self._htmlElements
开发者ID:molhokwai,项目名称:libraries,代码行数:27,代码来源:RunForm.py

示例2: themesPanel

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
	def themesPanel(self, themes=None):
		Window.alert('line:111')
		themes = None
		if not themes: themes=['0','1', 'cms', 'pypress']

		vPanel = VerticalPanel()
		for i in range(len(themes)):
			"""
			a_n = location.getPathName().split('/')[1]
			lambda1 = lambda x: w_l.pathname.replace('/'+a_n+'/', '/'+x+'/')+'?theme='+x
        	lambda2 = lambda x: w_l.pathname.replace('/'+a_n+'/', '/a/')+'?theme='+x
			href = {
				'cms' : lambda1, 
				'pypress' : lambda1,
				'o' : lambda2, 
				'1' : lambda2 
			}.get(themes[i], lambda2)(themes[i])
			"""

			a=Button('theme '+themes[i], 
					lambda x: location.setSearchDict({'theme': x.getID()}), 
					StyleName='link')
			a.setID(themes[i])
			vPanel.add(a)
	
		return vPanel
开发者ID:molhokwai,项目名称:libraries,代码行数:28,代码来源:Index0.py

示例3: themesPanel

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
 def themesPanel(self, themes=None):
     themes = None
     if not themes: themes=['0','1', 'cms', 'pypress']
     
     vPanel = VerticalPanel()
     vPanel.setID('themes')
     for i in range(len(themes)):
         a=Button('theme %s' % themes[i], Index.toTheme, StyleName='link')
         a.setID(themes[i])
         vPanel.add(a)
 
     return vPanel
开发者ID:molhokwai,项目名称:a,代码行数:14,代码来源:Index0.py

示例4: themesPanel

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
	def themesPanel(self, themes=None):
		themes = None
		if not themes: themes=['0','1', 'cms', 'pypress']

		vPanel = VerticalPanel()
		for i in range(len(themes)):
			a=Button('theme '+themes[i], 
					lambda x: location.setSearchDict({'theme': x.getID()}), 
					StyleName='link')
			a.setID(themes[i])
			vPanel.add(a)
	
		return vPanel
开发者ID:molhokwai,项目名称:libraries,代码行数:15,代码来源:Index.py

示例5: htmlElements

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
	def htmlElements(self, addList = None):
		if not self._htmlElements:
			h = HTML("<h1>Hello from %s</h1>" % location.getHref(), StyleName='font-s07em')
			p = HTML('<p>Enter vaild CreationTimeFrame code and submit...</p>')
			m = HorizontalPanel()
			t = TextArea(StyleName='page-textarea')
			b=Button('submit', self, StyleName='link')
			b.setID('submitButton')

			self._htmlElements = [['h', h], ['p', p], ['m', m], ['t', t], ['b', b]]
			for i in range(len(self._htmlElements)):
 				RootPanel().add(self._htmlElements[i][1])

		if addList:
			self._htmlElements+=addList
			for i in range(len(self._htmlElements)):
 				RootPanel().add(addList[i][1])

		return self._htmlElements
开发者ID:molhokwai,项目名称:libraries,代码行数:21,代码来源:Index.py

示例6: HomePanel

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
class HomePanel(AbsolutePanel):

    def __init__(self, parent):
        AbsolutePanel.__init__(self)
        self.home_header = Label("Blogjamas", StyleName="header_label")
        self.write_button = Button("Write a Post")
        self.edit_hidden_button = Button("", StyleName="hidden_button")
        self.delete_hidden_button = Button("", StyleName="hidden_button")
        self.add(self.home_header)
        self.add(self.write_button)
        self.add(self.edit_hidden_button)
        self.add(self.delete_hidden_button)

    def update_posts(self, posts):
        self.contents = VerticalPanel(Spacing=1)
        for i in range(len(posts)):
            self.divider = HTML("----------------------------------------------------")
            self.contents.add(self.divider)
            self.post_title = Label(posts[i].title, StyleName="title_label")
            self.contents.add(self.post_title)
            self.post_content = Label(posts[i].content, StyleName="content_label")
            self.contents.add(self.post_content)
            self.edit_button = Button("Edit")
            self.edit_button.setID("edit_" + posts[i].post_id)
            self.edit_button.addClickListener(self.show_edit_box)
            self.contents.add(self.edit_button)
            self.delete_button = Button("Delete")
            self.delete_button.setID("delete_" + posts[i].post_id)
            self.delete_button.addClickListener(self.delete_post)
            self.contents.add(self.delete_button)
        self.add(self.contents)

    def show_edit_box(self, sender):
        self.edit_hidden_button.setID(sender.getID())
        self.edit_hidden_button.click(self)

    def delete_post(self, sender):
        self.delete_hidden_button.setID(sender.getID())
        self.delete_hidden_button.click(self)
开发者ID:Afey,项目名称:pyjs,代码行数:41,代码来源:components.py

示例7: defenditt

# 需要导入模块: from pyjamas.ui.Button import Button [as 别名]
# 或者: from pyjamas.ui.Button.Button import setID [as 别名]
    """)

def defenditt():
    #Characters
    snoo = Image("./public/media/reddit alien.png")
    suit = Image("./public/media/suit.png")
    bullet = Image("./public/media/bullet.png")
    suit()
    pass

def suit():
    """spawn a zombie marketer at a random Y at the far right"""
    # 300, random.randrange(0,250)


class OurCanvas(Canvas):
    def __init__(self):
        Canvas.__init__(self, 300, 250)
        self.img = CanvasImage('media/splash screen.png', self)
        self.draw()
    


if __name__ == '__main__':
    #Canvas.__init__(0,0)
    b = Button("Start Game", start)
    b.setID('startbutton')
    RootPanel().add(b)
    hw = HTML("<img src='http://github.com/jrabbit/Defenditt/raw/master/public/media/splash%20screen.png' alt='start screen'/>")
    hw.setID("splash")
    RootPanel().add(hw)
开发者ID:jrabbit,项目名称:Defenditt,代码行数:33,代码来源:pyhelloworld.py


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