logo       

Re: using the same callback for a check menu and a toggle toolbutton: msg#00111

gnome.gtk+.python

Subject: Re: using the same callback for a check menu and a toggle toolbutton

John Finlay wrote:
Ionutz Borcoman wrote:

Hi,

I have a toggle button on my toolbar and a check menu in my menu. They do the same thing and must stay sincronized - when I check the menu, the toggle button get's activated, for example.

Both widgets show the state of an internal flag (for example __zoomBestFit).

What's the simplest way to handle this? What is the best way?

I recommend using PyGTK 2.4 which has Action, ActionGroup and UIManager objects that can be used to create and manage menuitems and toolitems. See the example in the examples/pygtk-demo/ui_manager.py program in the PyGTK 2.4 source code.

John


Does this work with glade? My windows are designed with glade and then loaded with libglade.

TIA,

Ionutz

_______________________________________________
pygtk mailing list pygtk@xxxxxxxxxx
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise