Skip to content

Commit bb88cef

Browse files
committed
Defined some children keys to append instructions, to make it possible access them simply.
1 parent 4d38f8a commit bb88cef

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

examples/helloworld_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def __init__(self, *args):
2525
super(MyApp, self).__init__(*args)
2626

2727
def main(self):
28-
#creating a container VBox type, vertical
28+
#creating a contner VBox type, vertical
2929
wid = gui.VBox(width=300, height=200)
3030

3131
#creating a text label
32-
self.lbl = gui.Label('Hello', width='80%', height='50%')
32+
self.lbl = gui.Label('Hello\n test', width='80%', height='50%', style={"white-space":"pre"})
3333

3434
#a button for simple interaction
3535
bt = gui.Button('Press me!', width=200, height=30)

examples/onclose_window_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ def on_window_close(self):
4646
# optional parameters
4747
# start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)
4848
start(MyApp, debug=True, address='0.0.0.0', port=0, start_browser=True) #standalone=True)
49+
print("potatoes")

remi/gui.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,12 +1834,12 @@ def __init__(self, title='', message='', *args, **kwargs):
18341834
if len(title) > 0:
18351835
t = Label(title)
18361836
t.add_class('DialogTitle')
1837-
self.append(t)
1837+
self.append(t, "title")
18381838

18391839
if len(message) > 0:
18401840
m = Label(message)
18411841
m.style['margin'] = '5px'
1842-
self.append(m)
1842+
self.append(m, "message")
18431843

18441844
self.container = Widget()
18451845
self.container.style.update({'display':'block', 'overflow':'auto', 'margin':'5px'})
@@ -1853,13 +1853,13 @@ def __init__(self, title='', message='', *args, **kwargs):
18531853
hlay = Widget(height=35)
18541854
hlay.style['display'] = 'block'
18551855
hlay.style['overflow'] = 'visible'
1856-
hlay.append(self.conf)
1857-
hlay.append(self.cancel)
1856+
hlay.append(self.conf, "confirm_button")
1857+
hlay.append(self.cancel, "cancel_button")
18581858
self.conf.style['float'] = 'right'
18591859
self.cancel.style['float'] = 'right'
18601860

1861-
self.append(self.container)
1862-
self.append(hlay)
1861+
self.append(self.container, "central_container")
1862+
self.append(hlay, "buttons_container")
18631863

18641864
self.conf.onclick.connect(self.confirm_dialog)
18651865
self.cancel.onclick.connect(self.cancel_dialog)
@@ -2902,13 +2902,13 @@ def __init__(self, multiple_selection, selection_folder, allow_file_selection, a
29022902
self.pathEditor.set_size('80%', '100%')
29032903
self.pathEditor.style['resize'] = 'none'
29042904
self.pathEditor.attributes['rows'] = '1'
2905-
self.controlsContainer.append(self.controlBack)
2906-
self.controlsContainer.append(self.pathEditor)
2907-
self.controlsContainer.append(self.controlGo)
2905+
self.controlsContainer.append(self.controlBack, "button_back")
2906+
self.controlsContainer.append(self.pathEditor, "url_editor")
2907+
self.controlsContainer.append(self.controlGo, "button_go")
29082908

29092909
self.itemContainer = Widget(width='100%',height=300)
29102910

2911-
self.append(self.controlsContainer)
2911+
self.append(self.controlsContainer, "controls_container")
29122912
self.append(self.itemContainer, key='items') # defined key as this is replaced later
29132913

29142914
self.folderItems = list()

0 commit comments

Comments
 (0)