Exemple #1
0
//-----------------------------------------------------------------------------
void test_cb(Fl_Widget* w, void*) {
	Fl_Menu_* mw = (Fl_Menu_*)w;
	const Fl_Menu_Item* m = mw->mvalue();
	if (!m)
		printf("NULL\n");
	else if (m->shortcut())
		printf("%s - %s\n", m->label(), fl_shortcut_label(m->shortcut()));
	else
		printf("%s\n", m->label());
}
Exemple #2
0
/*----------------------------------------------------*/
void 
test_cb (Fl_Widget* w, void*) 
{
  Fl_Menu_* mw = (Fl_Menu_*)w;
  const Fl_Menu_Item* m = mw->mvalue();

  if (!m) {
    printf("NULL\n");
		return;
	}

	if      (strcmp(m->label(), "Exit")==0) 
		exit(0);
	else if (strcmp(m->label(), "Min Menu")==0) {
		printf("-- Min Menu -- \n");
		window->make_current();
		fl_color(FL_RED);  
		fl_rectf(50, 50, 20, 20);

		static Fl_Button b1(60, 100, 80, 25, "&Beep");                       
		window->add(b1);

		window->redraw();
		

		/* mw->menu(big_menu); */
		/* (w->parent())->redraw(); */
		/* redraw(); */
		/* w->show(); */ /* ??? */
	} else {
		MessageBox (m->label());
	}

  if (m->shortcut())
    printf("%s - %s\n", m->label(), fl_shortcut_label(m->shortcut()));
  else
    printf("%s\n", m->label());

	/* char buffer[80]; */

}
Exemple #3
0
 FL_EXPORT_C(const char*,flc_shortcut_label_with_eom)(unsigned int shortcut,const char **eom){
   return fl_shortcut_label(shortcut,eom);
 }
Exemple #4
0
 FL_EXPORT_C(const char*,flc_shortcut_label)(unsigned int shortcut){
   return fl_shortcut_label(shortcut);
 }