def widget(self, item): """ returns the topmost mGui item of a templated list item, along with any events defined in the widget """ with forms.HorizontalForm(None) as root: r = controls.Button(None, label=str(item)) return Templated(item, root, command=r.command)
def example_HorizontalForm(): """ Example: import mGui.examples.formExamples as formExamples formExamples.example_HorizontalForm() """ with gui.Window(None, title="Example") as window: with forms.HorizontalForm(None, width=320) as main: for item in commands2: gui.Button(None, label=str(item['label'])).command += item['command'] cmds.showWindow(window)
def example_HorizontalForm(*args, **kwargs): """ Example: import mGui.examples.formExamples as formExamples formExamples.example_HorizontalForm() """ with gui.Window(title="HorizontalForm", height=64, width=512) as window: with forms.HorizontalForm(width=320, margin=(12, 12)) as main: gui.ScrollField(text="Components stack horizontally", ed=0, width=128, ww=True) for label, command in COMMANDS: gui.Button(label=label, width=80).command += command window.show()