>
> On 30 Aug 2008, at 12:28, Pippo wrote:
>
> > It's me again. It looks like the mouse pointer is always over one
> > of the buttons of the fl_choice() window. So I think that when it
> > appears it still intercepts the OLD mouse button event used to
> > select the Menu Item.
> >
> > Is there a way to avoid this? I tried to put a Sleep(1s) before
> > fl_choice(), but it is seems it is not a matter of time. fl_choice
> > () intercepts old events..
>
> I thunk you might have to post a minimal but complete, compileable
> example that manifests the fault.
> From you description so far, I don't have enough information to
> comment on what you are doing.
I cannot give the whole project to compile, as it would require that you set up
all the environment for the compilation. However there's not much to say about
the code causing the mentioned problem. This is the fragment of code: it's the
callback created by FLUID and called when the user presses the "File->Esci"
Menu Item:
void TextCaptureUI::cb_Esci_i(Fl_Menu_*, void*) {
if (conf->preferences.save_on_exit && conf->preferences.start_capturing &&
!c_browser->nchecked()) {
int i = fl_choice("Come impostazione predefinita si e' scelto di\n"
"attivare la registrazione dei messaggi al prossimo
riavvio del programma,\n"
"benche' non sia stato selezionato alcun profilo
nella lista.\n"
"Se esci ora tale impostazione verra' disabilitata,\n"
"altrimenti puoi tornare indietro e selezionare un
profilo manualmente.\n"
"Cosa vuoi fare?", NULL, "Esci ora!", "Torna
indietro");
if (i == 1)
conf->preferences.start_capturing = false;
else
return;
}
What happens in the process is that, after pressing the Menu Item, the above
callback is called, but fl_choice() window is showed and closed immediately (I
can notice the window appearing and disappearing as it were a flash). I am
almost sure that this happens because the window itself is centered in a way
that the mouse pointer is always over the "Esci ora!" button and the
intercepted mouse click event is still the cached/old one used when pressing
the previous Menu Item. In facts, by debugging, the rest of the code after
fl_choice() executes fine and i is always 1.
As I said, this problem does not happen always. You may wonder why I assert
that "the mouse pointer is always over a button": the reason is that when this
problem does not happen and fl_choice() work as expected, I can see the mouse
pointer button over the "Esci ora!" button.
I hope the problem is clear..
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk