PyScore

01: # -*- python -*-
02: ##### guiview.py ##### python package PyScore.timesheet module gui.view #####
03: 
04: # PyScore
05: # a race scoring programme
06: # written by Matt Draisey
07: # 2004 April 6
08: 
09: reloadables=[]
10: 
11: ##### guiview.py ##### python package PyScore.timesheet module gui.view #####
12: 
13: import sys,os
14: import gtk,gtk.glade,gobject
15: 
16: # set up singleton gui
17: 
18: widgets=gtk.glade.XML(os.path.join(sys.path[0],'glade/timesheet.pyscore.glade'))
19: 
20: widgets.get_widget('vbox1').set_focus_chain((
21:     widgets.get_widget('hbox1'),
22:     widgets.get_widget('hbox7'),
23: ))
24: 
25: widgets.get_widget('hbox1').set_focus_chain((
26:     widgets.get_widget('frame1'),
27:     widgets.get_widget('frame2'),
28:     widgets.get_widget('frame3'),
29:     widgets.get_widget('frame4'),
30: ))
31: 
32: widgets.get_widget('hbox7').set_focus_chain((
33:     widgets.get_widget('entry5'),
34: ))
35: 
36: # menu actions here in case of major bugs in import code
37: 
38: widgets.signal_autoconnect({
39:     "gtk_main_quit": lambda *x: gtk.main_quit(),
40:     "on_quit1_activate": lambda *x: gtk.main_quit(),
41: })
42: 
43: # the widgets
44: 
45: entrywindow=widgets.get_widget('window1')
46: entrywindow.connect("delete-event", lambda *x: gtk.main_quit())
47: 
48: # the widgets
49: 
50: entryview=widgets.get_widget('treeview1')
51: enterbutton=widgets.get_widget('button1')
52: entrybox=[widgets.get_widget('entry'+x) for x in "12345"]
53: 
54: completions=entrybox[0:4]+[entryview]
55: compbook=widgets.get_widget('notebook1')
56: compview=[widgets.get_widget('treeview'+x) for x in "2345678"]
57: summary=widgets.get_widget('vbox3')
58: complabel=[widgets.get_widget('label'+x) for x in "56789"]
59: 
60: entryview.set_property("can-focus",True)
61: enterbutton.set_property("can-focus",False)
62: enterbutton.set_property("can-default",True)
63: enterbutton.set_property("has-default",True)
64: for eb in entrybox:
65:     eb.set_property("can-focus",True)
66:     eb.set_property("activates-default",True)
67: compbook.set_property("can-focus",False)
68: for cv in compview: cv.set_property("can-focus",False)
69: for cl in complabel: cl.set_property("can-focus",False)
70: 
71: compcheckbuttontoggle=[widgets.get_widget('checkbutton'+x) for x in "123456"]
72: 
73: ##### guiview.py ##### python package PyScore.timesheet module gui.view #####