MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / add_button

Method add_button

gui-apps/app_kivy.py:120–135  ·  view source on GitHub ↗
(*t)

Source from the content-addressed store, hash-verified

118 def showcase_floatlayout(self, layout):
119
120 def add_button(*t):
121 if not layout.get_parent_window():
122 return
123 if len(layout.children) > 5:
124 layout.clear_widgets()
125 layout.add_widget(Builder.load_string('''
126#:import random random.random
127Button:
128 size_hint: random(), random()
129 pos_hint: {'x': random(), 'y': random()}
130 text:
131 'size_hint x: {} y: {}\\n pos_hint x: {} y: {}'.format(\
132 self.size_hint_x, self.size_hint_y, self.pos_hint['x'],\
133 self.pos_hint['y'])
134'''))
135 Clock.schedule_once(add_button, 1)
136 Clock.schedule_once(add_button)
137
138 def showcase_boxlayout(self, layout):

Callers

nothing calls this directly

Calls 1

add_widgetMethod · 0.80

Tested by

no test coverage detected