Re: settting the background and foreground



Are you calling set_background after you .show() the widget?

On Mon, Jan 10, 2011 at 4:32 PM, Charles Seedle <charles seedle rigaku com> wrote:

I am tring to set the background and foreground of my main window. Is there a good example of how to do this out there ?

I keep getting the messeges:

 

 

(Hello:22855): Gdk-CRITICAL **: gdk_gc_new: assertion `drawable != NULL' failed

 

(Hello:22855): Gdk-CRITICAL **: gdk_gc_set_foreground: assertion `GDK_IS_GC (gc)' failed

 

(Hello:22855): Gdk-CRITICAL **: gdk_gc_set_background: assertion `GDK_IS_GC (gc)' failed

 

(Hello:22855): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

 

 

>From this code:

  Glib::RefPtr<Gdk::Window> win = get_window();

 

  Glib::RefPtr<Gdk::GC> some_gc = Gdk::GC::create(win);

  Glib::RefPtr<Gdk::Colormap> some_colormap = get_default_colormap();

  set_decorated(false);

 

  my_gray.set_red(0xc900);

  my_gray.set_green(0xca00);

  my_gray.set_blue(0xc800);

 

  some_colormap->alloc_color(my_gray);

  some_gc->set_foreground(my_gray);

 

  my_blue.set_red(0x0000);

  my_blue.set_green(0x7200);

  my_blue.set_blue(0xc800);

 

  some_colormap->alloc_color(my_blue);

  some_gc->set_background(my_blue);

 

 

 

 

Randy


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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