File: glade.py

package info (click to toggle)
python-gtk 0.5.3-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,604 kB
  • ctags: 4,295
  • sloc: ansic: 19,390; python: 8,220; makefile: 91; sh: 26
file content (27 lines) | stat: -rwxr-xr-x 530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
import sys
if sys.version[:3] == '1.4':
	import ni
from Gtkinter import *
import pyglade

if len(sys.argv) > 1:
	fname = sys.argv[1]
else:
	fname = 'test.glade'

# create widget tree ...
wtree = pyglade.construct(fname)

# if there is anything that needs to be added to the UI, we can access all
# the widgets like this:
try:
	win = wtree.get_widget('window1')
except: pass

# we can connect to any of the signals named in the template:
try:
	wtree.connect('close_window', mainquit)
except: pass

mainloop()