Re: Our size allocation issues



Hi Owen,

On Wed, 21 Aug 2002, Owen Taylor wrote:

>
> Michael Meeks <michael ximian com> writes:
>
> > 	I'd like to know a better time to do the negotiation then - I can hook
> > any signal / virtual method on the GtkWidget, it doesn't concern me. I
> > have one requirement: that I be able to get a valid 'GdkScreen' for that
> > widget. It's not at all clear to me how I can trap the "got valid
> > screen" event - short of some bug riddled forest of add/remove signal
> > handlers on distant parents of the GtkSocket. Any better ideas ? realize
> > time seemed the obvious solution ?
>
> It's not that hard to do ... tracking getting *a* valid screen
> is simply tracking when the widget has been added to a toplevel ...
> that is, the ::hierarchy-changed signal. Tracking the current
> screen requires connecting to notify::screen on the current
> toplevel; gtkfontsel and gtktoolbar do this.

	Okay, just want to make sure I'm misunderstanding anything :-)
You're suggesting this as a way to determine when a widget gets a
screen *before* realize right ?

	I think I did this in places (where I didn't need the info
this early) by tracking realize and unrealize and doing
gdk_drawable_get_screen (widget->window) at those times since a
realized window must have a valid screen associated with it ..

Cheers,
Mark.




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