]> Creatis software - bbtk.git/blob - packages/wx/bbs/appli/exampleGUI1.bbs
0271ef873d9b8cf820b458dfa9fb70fbd7e805ca
[bbtk.git] / packages / wx / bbs / appli / exampleGUI1.bbs
1
2 description "Example of automatic gui creation with bbi command 'newgui'"
3 category "example"
4 author "laurent.guigues@creatis.insa-lyon.fr"
5
6 load std
7 include wx
8
9 # Create a Add box
10 new Add a
11
12 # Set the initial values of its inputs :
13 # will be used to initialize the GUI
14 set a.In1 10
15 set a.In2 20
16
17 # And create its GUI
18 # create a GUI for box 'a' and call it 'ag'
19 # this bbi macro inspects the box provided 
20 # and define a complex box called agType
21 # which contains the suitable GUI components 
22 # for the box provided (see User's Guide for details)
23 # an instance of 'agType' called 'ag' is then created
24 # and its output are connected to the corresponding inputs of 'a'
25
26 # setting "Echo" message level to 2 allow
27 # to see which commands are generated by the macro 'newgui'
28 message echo 2
29 newgui a ag
30 message echo 0
31
32 # Define the properties of the window of the GUI box created
33 set ag.WinTitle "Automatic GUI"
34 set ag.WinWidth 400
35 set ag.WinHeight 200
36
37
38 # Output of the add box
39 new OutputText out
40 connect a.Out out.In
41 set out.WinWidth 200
42 set out.WinHeight 200
43
44 # Connect changes of the GUI to the execution of the output 
45 # to refresh the output each time the user interacts with the GUI
46 connect ag.BoxChange out.BoxExecute
47
48 # go
49 exec out