Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/es/tutorials/Tutorial_08_gtk_ventana_boton.py
blob: 3a72a1c1b1b389ea6842215c18562b226ee3feeb (plain)
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
from gi.repository import Gtk

class PyApp(Gtk.Window):
    def __init__(self):
        super(PyApp, self).__init__()
        
        self.set_title("Boton")
        self.set_size_request(250, 200)
        
        def button_cb(widget):
            print 'click'

        button = Gtk.Button("Boton")
        fixed = Gtk.Fixed()
        fixed.put(button, 20, 30)
        button.connect('clicked', button_cb)
        
        self.connect("destroy", Gtk.main_quit)
        
        self.add(fixed)
        self.show_all()


PyApp()
Gtk.main()