File: testcharsel.py

package info (click to toggle)
python-gtkextra 0.21-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,284 kB
  • ctags: 1,618
  • sloc: ansic: 8,966; python: 4,231; makefile: 43
file content (26 lines) | stat: -rwxr-xr-x 650 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
#!/usr/bin/env python

from gtk import *
from gtkextra import *

class Application(GtkCharSelection):

    def __init__(self):
        GtkCharSelection.__init__(self)
        self.connect("destroy", mainquit)
        self.cancel_button.connect("clicked", mainquit)
        self.ok_button.connect("clicked", self.ok_clicked)
        self.show()

    def ok_clicked(self, *args):
        psfont = self.font_combo.psfont
        psname = psfont.psname
        code = self.get_selection()
        print "%s, %d" % (psname, code)
        
    def mainloop(self):
        mainloop()

if __name__ == '__main__':		
    app = Application()
    app.mainloop()