Changing the background color of a window

2003-02-25 Thread j. santana
Hi I'm trying to change the background color of a window randomly, but I always get a black filled window, even though I get random values from g_rand. (I'm trying this as an exercise in learning GTK.) What would be the best way to achieve this effect ? static int configure_event_cb(GtkWidget *

Re: Changing the background color of a window

2003-02-25 Thread Sven Neumann
Hi, j. santana [EMAIL PROTECTED] writes: I'm trying to change the background color of a window randomly, but I always get a black filled window, even though I get random values from g_rand. (I'm trying this as an exercise in learning GTK.) Colors are especially hard to get right so this

Re: Changing the background color of a window

2003-02-25 Thread Havoc Pennington
On Tue, Feb 25, 2003 at 06:42:20PM +0100, Sven Neumann wrote: Hi, j. santana [EMAIL PROTECTED] writes: I'm trying to change the background color of a window randomly, but I always get a black filled window, even though I get random values from g_rand. (I'm trying this as an

Re: Changing the background color of a window

2003-02-25 Thread José Vitor de Santana
Havoc Pennington wrote: I don't think gtk_widget_modify_bg() requires allocating the color... I eventually got my test program running fine, see my reply to Sven. In general with GTK 2 allocating/freeing colors should never be necessary, gdk_rgb_find_color() and

Re: Changing the background color of a window

2003-02-25 Thread José Vitor de Santana
Havoc Pennington wrote: I don't think gtk_widget_modify_bg() requires allocating the color... I eventually got my test program running fine, see my reply to Sven. In general with GTK 2 allocating/freeing colors should never be necessary, gdk_rgb_find_color() and

Re: Changing the background color of a window

2003-02-25 Thread Havoc Pennington
On Tue, Feb 25, 2003 at 11:14:32PM -0500, José Vitor de Santana wrote: But indeed it must have been parsed by gdk_color_parse before feeding it to gtk_widget_modify_bg. That's what I found. No, definitely gdk_color_parse isn't required. All gdk_color_parse does is fill in color.red,