Re: focus_out_event' on GTK_COMBO(..)->entry crashes



calmar <mac calmar ws> writes:

> I have just a function 'messagebox(); there actually, which works
> properly all the time. I tried it also with just an empty callback
> function (messagebox outcommented), what also crashed.
> compiled with gcc on linux, wich normally also workes.
> 
> g_signal_connect (G_OBJECT (GTK_COMBO (combo)->entry), "focus_out_event",
>                       G_CALLBACK (deck_callback), NULL);
> // I tried this also with instead of NULL as data, with a string like this "test"
> 
> void deck_callback ( GtkWidget *button,gpointer   data)  			//{{{
> {
> //	messagebox("in deck callback");
> }
> //}}}
> 
> I should try it out on linux once, in order to see what happens there. I will try it later.
> 
> thanks calmar

The bug here is that all "*_event" callbacks have a gboolean return,
the meaning being:

 TRUE  - I handled the event, no further processing is necessary
 FALSE - continue processing as normal

With a void return, the effect will be random. Here you must
return FALSE, or GTK+'s internal processing will get confused.

Current versions of GTK+ will actually print out:

      GtkEntry - did not receive focus-out-event. If you
      connect a handler to this signal, it must return
      FALSE so the entry gets the event as well

before aborting as in the above - I'm not sure if you don't
get it because a) it's going some place on Win32 that you
don't see. b) your version of GTK+ is too old. (It was
added between GTK+-2.0.3 and GTK+-2.0.4.)

Regards,
                                        Owen



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