Re: pixmaps and xpm-transparency



Tobias Hintze wrote:
> 
> On Sun, Apr 22, 2001 at 02:34:45PM +0200, Tobias Hintze wrote:
> > >
> > > You need to set the clip mask in the graphics context used for the
> > > draw using gdk_gc_set_clip_mask and gdk_gc_set_clip_origin.
> >
> > yes. this one just works too.
> 
> 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?

I make an invisible top level window as my application starts (realised,
but not shown), then use that to grab GCs etc. for all the other
windows. Not the best way, but very easy.

        gtk_init( argc, argv );
#ifdef DEBUG
        gdk_rgb_set_verbose( TRUE );
#endif /*DEBUG*/
        gdk_rgb_set_min_colors( 64 );
        gdk_rgb_init();

        main_window_top = gtk_window_new( GTK_WINDOW_TOPLEVEL );
        gtk_widget_realize( main_window_top );


John




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