Re: GtkEntry and Gtk2.0

Thanks very much for the rapid response. Yes that was it. I had returned
FALSE for the main callback but forgot my "fallthrough" function which was
there to ignore unwanted events. This was returning TRUE and causing the
problem. Program now fully ported! Thanks once again for the help.
Nick Soffe.

On 25 Mar 2002, Havoc Pennington wrote:

> Nick Soffe <nick soffe bioch ox ac uk> writes:
> > I'm trying to port one of my programs from Gtk1.2 to Gtk2.0 (nearly
> > successfully) but have encountered one problem. I have a routine which
> > counts mouse motion events to adjust numbers in a GtkEntry box. This
> > enables an user to have fine control over a parameter which can also be
> > entered manually. To do this I gdk_pointer_grab the entry and
> > gtk_signal_connect(GTK_OBJECT(entry),"event",handler,etc). My callback
> > traps for either GDK_MOTION_NOTIFY to update the count with gtk_set_text
> > or GDK_BUTTON_PRESS to exit. Under Gtk1.2 this works fine and the entry
> > visibly updates during adjustment. Under Gtk2.0 the entry blanks when the
> > first "event" occurs and won't display the updated number until the event
> > handler is disconnected on quitting the routine. I've tried to eliminate
> > as much of the related code as possible.
> > GtkEntry clearly works differently but I can't find any hints in the docs.
> > No gtk errors are produced whilst running and everything else works fine.
> > Any ideas/suggestions about this would be gratefully received.
> Does your "event" callback return TRUE? It should return FALSE.  This
> was also theoretically true of GTK 1.2, though in 1.2 the consequences
> of returning the wrong thing were usually small or nonexistent.
> (return TRUE stops processing of that event immediately in 2.0, while
> it only stopped propagation to parent widgets in 1.2)
> Havoc

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