> Pippo wrote:
>> I cannot give the whole project to compile,
Greg Ercolano wrote:
>
> Right, can't you write a small program that just opens a window
> and posts a menu in the same way your big app does, and have the
> callback invoke the fl_choice(), again, in the same way your app does?
>
> We definitely don't want to see your whole project. Just write
> a small app that uses the same key techniques you're using, as
> we can't guess what they are.
For instance, I wrote this, and it seems to work for me.
Change this program to be more like yours, and if you can replicate,
send us the changes so we can see it.
#include <FL/Fl.H>
#include <FL/fl_ask.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Menu.H>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void handle_menu(Fl_Widget *w, void *v) {
const char *s = (const char*)v;
if ( strcmp(s, "Quit") == 0 )
{ exit(0); }
if ( strcmp(s, "Open Choice") == 0 )
{ printf("choice=%d\n", fl_choice("Text text.", "Zero", "One", "Two"));
}
}
void push_cb(Fl_Widget *w, void*) {
Fl_Menu_Item rclick_menu[] = {
{ "Open Choice", 0, handle_menu, (void*)"Open Choice" },
{ "Quit", 0, handle_menu, (void*)"Quit" },
{ 0 }
};
const Fl_Menu_Item *m = rclick_menu->popup(Fl::event_x(), Fl::event_y(), 0,
0, 0);
if ( m ) m->do_callback(w, m->user_data());
return;
}
int main() {
Fl_Window win(140,45,"Test");
Fl_Button butt(10,10,120,25,"Push For Menu");
butt.callback(push_cb);
win.show();
return(Fl::run());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk