Debian Codegraph @

fltk/test/browser_cols.py

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