container.draggable = True container.show_background = True container.width = 300 container.height = 500 toggle = Toggle(TextModel(font, 'Sound', 24)) toggle.active_image = chk_view toggle.inactive_image = x_view toggle.x = 30 toggle.y = 12 container.add_child(toggle) hbox = HBox() slider = HSlider(toggle.width) sound_level_label = TextView(TextModel(font, 'Sound Level', 14)) hbox.add_child(sound_level_label) hbox.add_child(slider) hbox.x = 38 hbox.y = toggle.y + toggle.height + 15 slider.y = hbox.height * 0.5 - slider.height * 0.5 container.add_child(hbox) scene.add_child(container) stage.start(scene)
inner_scene.add_child(Button(TextModel(font, 'Scene One', 18))) inner_scene2.add_child(Button(TextModel(font, 'Scene Two', 18))) menu2.add_child(inner_scene) menu2.add_child(scene_1) menu2.add_child(scene_2) def on_render(event, **kwargs): print event, kwargs stage = Stage() menu1 = Scene("Menu One") menu1.width = stage.width menu1.height = stage.height menu1.fill_color=(132, 134, 0) menu1.on('init', on_init) menu2 = Scene("Menu Two") menu2.width = stage.width menu2.height = stage.height menu2.fill_color=(132, 134, 127) menu2.on('init', on_init2) stage.start(menu1)