[Glade-users] help with menu item signals



Hi
Here is an excerpt from my glade file show how I have connected 
"activate" to the handler on_generate_orbits_activate
<child>
                      <widget class="GtkMenuItem" id="generate_orbits">
                        <property name="visible">True</property>
                        <property name="events">GDK_POINTER_MOTION_MASK 
| GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
                        <property name="label" 
translatable="yes">Generate Orbits</property>
                        <property name="use_underline">True</property>
                        <signal name="activate" 
handler="on_generate_orbits_activate"/>
                      </widget>
                    </child>


In my python code I have
---------------------------------
def on_edit_orbits_activate(widget):
    print "Editing Orbits"

signal_dict={"on_edit_orbits_activate":on_edit_orbits_activate}
widget=gtk.glade.XML('alignment.glade')
widget.signal_autoconnect(signal_dict)
------------------------------------
But I never get the print statement. I was able to do this for a Button. 
Why doesn't it work for a menu item?


Mathew









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