Sascha Manns
2017-02-10 13:04:31 UTC
Hello list,
i have defined a menu item "File/Quit" like so:
<object class="GtkMenuItem">
 <property name="visible">True</property>
 <property name="can_focus">False</property>
 <property name="label" translatable="yes">_Datei</property>
 <property name="use_underline">True</property>
 <child type="submenu">
    <object class="GtkMenu">
      <property name="visible">True</property>
      <property name="can_focus">False</property>
      <child>
        <object class="GtkImageMenuItem" id="menuQuit">
          <property name="label">gtk-quit</property>
          <property name="name">menuQuit</property>
          <property name="visible">True</property>
          <property name="can_focus">False</property>
          <property name="use_underline">True</property>
          <property name="use_stock">True</property>
          <signal name="activate" handler="OnMenuQuitActivate"
swapped="no"/>
        </object>
      </child>
    </object>
 </child>
</object>
How must be the "OnMenuQuitActivate" handler looks like, that it quits
the application?
I tried out:
protected void OnMenuQuitActivate(object sender, DeleteEventArgs a) {
    Application.Quit();
    a.RetVal = true;
}
But that doesn't work.
Greetings
Sascha
i have defined a menu item "File/Quit" like so:
<object class="GtkMenuItem">
 <property name="visible">True</property>
 <property name="can_focus">False</property>
 <property name="label" translatable="yes">_Datei</property>
 <property name="use_underline">True</property>
 <child type="submenu">
    <object class="GtkMenu">
      <property name="visible">True</property>
      <property name="can_focus">False</property>
      <child>
        <object class="GtkImageMenuItem" id="menuQuit">
          <property name="label">gtk-quit</property>
          <property name="name">menuQuit</property>
          <property name="visible">True</property>
          <property name="can_focus">False</property>
          <property name="use_underline">True</property>
          <property name="use_stock">True</property>
          <signal name="activate" handler="OnMenuQuitActivate"
swapped="no"/>
        </object>
      </child>
    </object>
 </child>
</object>
How must be the "OnMenuQuitActivate" handler looks like, that it quits
the application?
I tried out:
protected void OnMenuQuitActivate(object sender, DeleteEventArgs a) {
    Application.Quit();
    a.RetVal = true;
}
But that doesn't work.
Greetings
Sascha