Re: A new 'gtktreeitem' widget proposal and some problems...




On Fri, 4 Dec 1998, Steven J. Hill wrote:
> 
> The first version worked fine except I kept getting the 'creation of
> pixmap with NULL window' warnings. I tried to understand the way the GDK
> draws X windows, but could not eliminate the warnings.
>

The window is not created until the widget is realized, so you should wait
until then to create your pixmaps.
 
> The second version I decided to use the method used in 'gtktreeitem'
> for dealing with the pixmaps and the warnings dissapeared, but I had to
> override the 'realize' procedure and therefore the '+' and '-' pixmaps
> associated with the parent class are not drawn because of the override.
> 

Just chain up to the parent's realize procedure from yours. In your
class_init function, keep a pointer to the parent class; then call
something like:
 (* GTK_WIDGET_CLASS(parent_class)->realize)(... insert args here... );

Almost all Gtk widgets do this at one point or another, so have a look
around the source code for examples...

Havoc



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