Re: pixmaps and xpm-transparency



Tobias Hintze <hintze_gtk siemens md st schule de> writes:
> just one question left:
> 
> currently i fetch the GC via 
> 
> style = gtk_widget_get_style(gRootWindow);
> style->fg_gc[GTK_STATE_NORMAL];
> 
> but that needs a already visible root-window.
> is there a better way?
> 

The Correct thing to do is to connect_after to the "realize" signal
and get your GC there. The hacky and not-so-forward-thinking way to do
it is to just call gtk_widget_realize() on the window so its X
resources will be created.

When thinking of realization, think about moving an app between two X
displays. So the way this would work is that you would unrealize the
window on one display, and re-realize it on another. This would mean
that all GC's, windows, pixmaps, etc. need to be destroyed on
unrealize and re-created on realize. So if your realize-related code
works in this case you are golden. (And this is why GDK resources like
widget->window only exist post-realization.)

Havoc






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