Re: GLib-GObject-CRITICAL messages when using a style color accessor

Chisheng Huang <[email protected]> Wed, 30 Apr 2008 13:47:22 -0700
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
Espen S Johnsen <[email protected]> writes:

> Chisheng Huang <[email protected]> writes:
>
>> I just noticed that a bunch of "GLib-GObject-CRITICAL" messages flying by in
>> my slime *inferior-lisp* window when my program was getting a color from a
>> gtk:style object.  The following code demonstrates the problem:
>> 
>> (let ((w (make-instance 'gtk:window)))
>>   (gtk:widget-show-all w)
>>   (gtk:style-mid (gtk:widget-style w)
>>                   :normal))
>> 
>> (<unknown>:25439): GLib-GObject-CRITICAL **: g_boxed_copy: assertion `G_TYPE_IS_BOXED (boxed_type)' failed
>> 
>> The returned color, #<GDK:COLOR at 0x0>, has a null pointer.
>
> Strange, I do not have this problem. What does (gtk:widget-style w) return?

When the returned color is #<GDK:COLOR at 0x0>, (gtk:widget-style w) returns
#<GTK:STYLE at 0x80FC9A8>.

A few more data points:
  1. If I do the following in a window (generated by gnome-terminal or xterm)

       lisp

       (asdf:oos 'asdf:load-op :gtk)

       (gtk:clg-init)

       (let ((w (make-instance 'gtk:window)))
         (gtk:widget-show-all w)
         (gtk:style-mid (gtk:widget-style w) :normal))

     I'll get a good color object.

  2. I'll get #<GDK:COLOR at 0x0> if my clg application program has already
     been running in the same CMU lisp image on Linux

  3. I'll get a good color object even if my clg application program has
     already been running in the same SBCL lisp image on Microsoft Windows.

  4. I originally noticed this Glib-Gobject-Critical messages while my clg
     program was running on Microsoft Windows.

As the screen area affected by this gtk:style-mid call was quite small, I
just hardcoded the colors there.

Thank you for looking into this.

Best,

-cph

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone