本文整理汇总了Python中pyjamas.ui.HTML.HTML.setID方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.setID方法的具体用法?Python HTML.setID怎么用?Python HTML.setID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.HTML.HTML
的用法示例。
在下文中一共展示了HTML.setID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from pyjamas.ui.HTML import HTML [as 别名]
# 或者: from pyjamas.ui.HTML.HTML import setID [as 别名]
def start(sender):
Window.alert("Hello, GAMERS!")
hw = HTML("<img src='http://github.com/jrabbit/Defenditt/raw/master/public/media/instructions%20screen.png' alt='instructions'/>")
hw.setID('instructions')
RootPanel().add(hw)
JS("""
parent.top.document.getElementById("splash").style.display = "none";
parent.top.document.getElementById("startbutton").style.display = "none";
parent.top.document.getElementById("startbutton").style.height = 0;
""")
示例2: defenditt
# 需要导入模块: from pyjamas.ui.HTML import HTML [as 别名]
# 或者: from pyjamas.ui.HTML.HTML 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)