songhir
songhir

Reputation: 3583

PyGTK, "do-configure-event" doesn't work?

The title of the window doesn't display event.x && event.y (see the code :D) .

I discover the method do_configure_event doesn't been called.

new to pygtk, many thx! :D

#!/usr/bin/env python2.7
# encoding:utf8
# sources: zetcode
import gtk
import gobject

class pyapp:
    __gsignals__ = {
        "configure-event" : "override"
    }
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect("destroy", gtk.main_quit)
        self.window.set_size_request(350,200)
        self.window.show_all()

    def do_configure_event(self, event):
        title = "%s, %s" % ( event.x, event,y)
        self.window.set_title(title)
        gtk.Window.do_configure_event(self, event)

pyapp()
gtk.main()

Upvotes: 0

Views: 169

Answers (1)

f4lco
f4lco

Reputation: 3814

Name your sources! It seems you're trying to adapt example code from Zetcode you do not fully comprehend.
Your problem is: to put your class attribute __gsignals__ into use, you have to derive from gtk.Window. The window instance looks up the signals and therefore its gsignals dictionary has to be filled. At the moment, this dictionary resides in pyapp.

Upvotes: 1

Related Questions