Re: Expose_event on GtkDrawingArea




Steve Hosgood <iisteve@iiweeble.swan.ac.uk> writes:

> I just found a surprising bit of behaviour which I'll try to describe in
> as small a posting as possible:
> 

[...]

> # ifdef OLD_WAY		
> 	gtk_signal_connect(GTK_OBJECT(darea), "expose_event", GTK_SIGNAL_FUNC(enquire), ( gpointer * ) darea);
           ^^^^^^^^^^^^^^
Just gpointer (though it won't change the behavior, just the warnings)

>  	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(enquire), ( gpointer * ) darea);


[...]
> 
> # ifdef OLDWAY
> void
> enquire( GtkWidget *gw, gpointer *data )
> {
> 	GtkWidget	*wptr = ( GtkWidget * ) data;

Your problem is that all _event signals, take three arguments,
not two. This should be:

void
enquire (GtkWidget *gw, GdkExposeEvent *event, gpointer data);

(As a consequence, you cannot use the same callback for
"clicked" and for "expose_event")

[...]
 
> P.S
> Another odd bit of behaviour, nothing to do with event handling is that the
> program from which the above is extracted does weird things when the window
> manager tries resizing it. Basically it won't let the window manager make
> it any narrower than the 300 pixels set in the "set_usize" call, yet it
> will allow itself to be made smaller vertically than the 200 pixels set
> in the same call to "set_usize"! I assume this is something to do with
> Afterstep - but has anyone seen similar behaviour elesewhere? I think I saw
> it do the same thing on FVWM too, but can't prove that right at the moment.

This is an Afterstep bug, if I recall correctly. (At least, there
was an Afterstep bug related to resizing)

Regards,
                                        Owen



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