[Glade-users] glade-3 and user data



Hi all,

I'm using a combination of Glade3/PyGTK to start my GTK+ learnings.  I'm
starting off fresh with the GtkBuilder way too.  Doing well so far, but I'm
having trouble using the "User Data" field in Glade.  I found another
message about this,
http://lists.ximian.com/pipermail/glade-users/2009-April/004314.html, but I
don't really understand what to do.

Using this as an example, what do I have to do differently?

class MyClass(object):
  def __init__(self):
    builder = gtk.Builder()
    builder.add_from_file('myglade.xml')
    builder.connect_signals(self)

I assume that was the "autoconnect" method described in that other post.  I
tried something like this, but still doesn't work:

class MyClass(object):
  def __init__(self):
    builder = gtk.Builder()
    builder.add_from_file('myglade.xml')
    builder.connect_signals({
        'on_button_clicked': self.on_button_clicked,
    })

  def on_button_clicked(self, widget, user_data=None):
    print user_data


I want to use this as a way to determine which column header was clicked in
a treeview, without having to write 2 separate signal handlers.  This may
not even be the best way...

Thanks in advance,

Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20090601/b5a81bd8/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]