> The following is a fragment of code I use to make a menu 
> which uses & (ampersand) shortcuts.
> The problem is the following:

You don't say what version of fltk you are using, or what host.

I'm assuming fltk-1.1 from your example (though 1.3 would be "the same")
and that the host does not matter... (it shouldn't!)

Anyway, the short answer is; if you *really* want shortcuts to work, you
are much better setting them explicitly, rather than relying on the
"&Name" mechanism...

The attached fluid file shows what I mean, I think it reflects your
example and the shortcuts work correctly.


# data file for the Fltk User Interface Designer (fluid)
version 1.0110 
header_name {.h} 
code_name {.cxx}
decl {\#include <stdio.h>} {} 

Function {} {open
} {
  Fl_Window main_win {
    label {menu test} open
    xywh {488 364 606 312} type Double visible
  } {
    Fl_Menu_Bar mb1 {open
      xywh {0 0 606 20}
    } {
      Submenu {} {
        label {&File} open
        xywh {0 0 62 20}
      } {
        MenuItem {} {
          label {&Open}
          callback {puts("open");
fflush(stdout);} selected
          xywh {0 0 30 20} shortcut 0x8006f
        }
      }
      MenuItem {} {
        label {&Top}
        callback {puts("top");
fflush(stdout);}
        xywh {5 5 30 20} shortcut 0x80074
      }
    }
  }
} 

------------------


SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to