[pygtk] gtk.Action.connect_proxy

Geoff Bache geoff.bache at jeppesen.com
Fri Mar 14 00:23:58 WST 2008


Hi all,

I can't persuade this to work as described unfortunately. The docs say

"This method synchronizes various properties of the |gtk.Action| 
<http://www.pygtk.org/docs/pygtk/class-gtkaction.html> with the widget 
(such as label text, icon, tooltip, etc), and attaches a callback so 
that the |gtk.Action| 
<http://www.pygtk.org/docs/pygtk/class-gtkaction.html> is activated when 
/|proxy|/ is."

As far as I can tell, when connecting a simple button as a proxy, all 
that gets transferred is the label text. The stock icon and tooltip at 
least are not transferred.
Is this to be expected?

Regards,
Geoff Bache

P.S. Here's my code:

#!/usr/bin/env python

import gtk

def buttonClicked(action, *args):
    print action

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect("delete_event", gtk.main_quit)
action = gtk.Action("The Action", "The Action", "Some tooltip", 
"gtk-refresh")
action.connect("activate", buttonClicked)
actionGroup = gtk.ActionGroup("The Action Group")
actionGroup.add_action(action)
button = gtk.Button()
action.connect_proxy(button) # button appears saying "The Action" but 
without an icon or a tooltip...
window.add(button)
window.show_all()
window.resize(100, 100)
gtk.main()




More information about the pygtk mailing list