File: hello2.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 (29 lines) | stat: -rwxr-xr-x 474 bytes parent folder | download | duplicates (2)
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
28
29
#!/usr/bin/env python

# this is a translation of "Hello World III" from the GTK manual,
# using Gtkinter

from Gtkinter import *

def hello(*args):
    print "Hello World"
    window.destroy()

def destroy(*args):
    window.hide()
    mainquit()

window = GtkWindow(WINDOW_TOPLEVEL)
window.connect("destroy", destroy)
window.border_width(10)

button = GtkButton("Hello World")
button.connect("clicked", hello)
window.add(button)
button.show()

window.show()

mainloop()