Debian Codegraph @

fltk/test/browserData.py

raw symbols SCIP
1
2 # browserData.py test program for pyFLTK the Python bindings
3 # for the Fast Light Tool Kit (FLTK).
4 #
5 # FLTK copyright 1998-1999 by Bill Spitzak and others.
6 # pyFLTK copyright 2003 by Andreas Held and others.
7 #
8 # This library is free software you can redistribute it and/or
9 # modify it under the terms of the GNU Library General Public
10 # License, version 2.0 as published by the Free Software Foundation.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Library General Public License for more details.
16 #
17 # You should have received a copy of the GNU Library General Public
18 # License along with this library if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 # USA.
21 #
22 # Please report all bugs and problems to "[email protected]".
23 #
24
25
26 print("""
27 This is a quick hack to check setting and getting browser data
28 """)
29
30 from fltk import *
31
32
33 # global object names
34 aBrowser = None # type 'Browser' from '()'
35
36
37 def onOK(ptr):
38 import sys # code
39 #checkBrowserCallback(aBrowser.this) # code
40 sys.exit(0) # code
41
42
43 def main():
44 global aBrowser
45
46 win = Fl_Window(394, 309, 245, 133, "check_browser.py")
47 #win.thisown = 0
48
49 aBrowser = Fl_Browser(5, 5, 240, 75)
50 #aBrowser.thisown = 0
51 aBrowser.end()
52
53 btn = Fl_Return_Button(160, 90, 70, 30, "OK")
54 #o_2_1.thisown = 0
55 btn.label('OK')
56 btn.callback(onOK)
57 win.label('check_browser.py')
58 win.end()
59 aBrowser.add("Guiness", "line 1" ) # code
60 aBrowser.add("Bud", "line 2") # code
61 aBrowser.add("Coors", "line 3")
62 aBrowser.add("rocky mountain", "line 4") # code
63 aBrowser.add("Grimbergen", "line 5") # code
64 aBrowser.add("Burning River", "line 6") # code
65 aBrowser.add("Little Kings", "line 7") # code
66
67 return win
68
69
70
71 if __name__=='__main__':
72 import sys
73 window = main()
74 window.show(len(sys.argv), sys.argv)
75 print(aBrowser)
76 d="data for 1"
77 print("data(1,"+d+")")
78 aBrowser.data(1, d)
79 aBrowser.data(2, 123)
80 print("data(1):", aBrowser.get_data(1))
81 print("data(2):", aBrowser.get_data(2))
82 print("data(3):", aBrowser.get_data(3))
83
84 Fl.run()
85