Accelerators not working in Windows



Hi list!

I've built an application that I'm compiling with g++ on linux and MinGW
cross-compiling with MinGW to run on windows. Anyway, I have a default
MenuBar created by Glade Interface Designer and I'm loading up the xml
file with Gtkmm. In Glade Interface Designer I have actions attached to
the ImageMenuItems I'm using, and accelerators set such as <ctrl>+s for
Save, just some standard stuff.

Anyway, in Linux everything works as expected, and in Windows the
accelerators don't seem to register at all. The actions are still
activated when I click on the items manually but not when I hit the
accelerators. What's more, in both Linux and Windows the accelerators
are listed next to the the menu items in the menu, like so:

New   Ctrl+N
Save  Ctrl+S
etc.

So Gtk know they're there in both Linux and Windows. Is there something
else I should be doing here?

On Ubuntu 9.10:
libgtk1.2         : 2.18.3-1ubuntu2
libgtkmm-2.4-1c2a : 1:2.18.2-1

Windows XP
gtkmm-win32-devel-2.16.0-4.exe from here: 
http://ftp.gnome.org/pub/GNOME/binaries/win32/gtkmm/2.16/

I think this windows package is using 2.16 of gtk, could that be why it
isn't working? Trying to change around my cross-compile environment to
use 2.18 will doubtless be a mess, but that's what I'll try if nobody
has any ideas.

Also, here's the XML generated:

...
<object class="GtkMenuBar" id="menubar1">
  <property name="visible">True</property>

  <child>
    <object class="GtkMenuItem" id="menuitem1">
      <property name="visible">True</property>
      <property name="label" translatable="yes">_File</property>
      <property name="use_underline">True</property>

      <child type="submenu">
        <object class="GtkMenu" id="menu1">
          <property name="visible">True</property>

<child>
  <object class="GtkImageMenuItem" id="imagemenuitem1">
    <property name="label">gtk-new</property>
    <property name="visible">True</property>
    <property name="related_action">newFile</property>
    <property name="use_underline">True</property>
    <property name="use_stock">True</property>
   <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
  </object>
</child>
...

Thanks everybody.



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