Re: Problems with 1.2.9 gdk_rgb [was Re: Gtk (cvs HEAD) -> gdk_pixbuf does'nt compile correcly.]
- From: James Henstridge <james daa com au>
- To: Chuck Mason <chuckjr unbounded com>
- Cc: gtk-devel-list gtk org
- Subject: Re: Problems with 1.2.9 gdk_rgb [was Re: Gtk (cvs HEAD) -> gdk_pixbuf does'nt compile correcly.]
- Date: Tue, 27 Mar 2001 22:24:57 +0800 (WST)
On 27 Mar 2001, Chuck Mason wrote:
> I've been forgetting to post this, and it's doing me no good just
> knowing this fact so I might as well tell everyone.
>
> A couple days ago I was writing a simple program: I created the
> interface in glade, and the main window had a menu, a GtkDrawingArea and
> that was it. I added a expose_event to the DrawingArea and used this
> code in that function:
>
[snip]
>
>
> .. And it segfaulted. This could mean (at first glance) a problem with
> my code. I spent HOURS trying to determine what was wrong, so I asked a
> friend to try the program (who was using the same version Gtk+ etc. at
> that time), and it worked! Why?
>
> Two days ago, I got bored with my Gnome settings so I got a new theme
> for my sawfish manager and gtk+ interface, and then decided to go back
> to my program to see if I could figure out what was wrong. It ran. What
> a surprise. I was confused at first, but I finally decided I would
> point my finger at the gdk theme engine (Not sure what you gtk-dev'ers
> call it officially).
>
> So, now this means one of 2 things: 1) I wrote some bad code, or 2)
> something is seriously broken in the gdk engine.
>
> I would like some feedback if anyone has anything to say about this.
This message is probably more appropriate for gtk-list.
GdkRGB works fine if you initialise its visuals and colormap before using
it. Before creating the widget you are using GdkRGB functions with, add
the following two lines:
gtk_widget_push_colormap(gdk_rgb_get_cmap());
gtk_widget_push_visual(gdk_rgb_get_visual());
And after creating the widget, you can pop the colormap and visual
again. Alternatively, you can put these lines just after gtk_init() to
use this visual/colormap for all widgets in your program.
James.
--
Email: james daa com au
WWW: http://www.daa.com.au/~james/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]