Re: GtkPreview changed behaviour




Hi Sven,

>> I noticed a difference in behaviour between the GTK 1.2 and GTK 2.0
>> GtkPreview widget. Somehow the following code used to work in GTK 1.2
>> (with gtk_signal_connect iso g_signal_connect, etc.) but in 2.0 the
>> "motion_notify_event" doesn't seem to get handled.
>>
>> g_signal_connect(G_OBJECT(widget), "motion_notify_event",
>>                           G_CALLBACK(button_motion), factory);
>>
>> The funtion 'button_motion' is never called.
>
>are you sure? I had a quick look at the state of the plug-in in CVS
>and it seems as if preview_move() gets called since the coordinates
>in the statusbar are correctly updated.

Yep, that's one of the things I don't understand: the preview_move() get's called, but the button_motion() isn't, even though both are connected to the same event ("motion_notify_event").  Which makes me think right now that I might have used the wrong declaration for preview_move(). If it's supposed to return a value (will look that up this evening) I can imagine that the other callback function is never called.

>The use of GDK_MOTION_NOTIFY as an event_mask (see your PREVIEW_MASK
>definition) is wrong by the way. It didn't do any harm however.


Ah, ok I just copied that part from another plugin a long time ago. Why shouldn't it be used and can I just remove it?

Kind regards,

Maurits

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