0

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()

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.