[gtkada] Coloring a window

Preben Randhol randhol at pvv.org
Thu May 16 16:06:20 CEST 2002


"Grein, Christoph" <christoph.grein at eurocopter.com> wrote on 15/05/2002 (10:20) :
> Hi folks,
> 
> how do I color my main window? This is the code generated by Glade. The lines 
> commented out were added by me to define a color in the color map, but this 
> crashes the program. And if it worked, how would I apply the color defined to my 
> window background?

This is because you try to set the Color on an object that doesn't exist
yet. 

In the code for your window you can put that you wrote below and then
you should do a Get_Style on the window and then you do Set_Background
and finally you use Set_Style on the window. Given that you want to
change the background of the window. 

Window_Style := Copy (Get_Style (Window1);
Set_Background (Window_Style, State_Normal, Color);
Set_Style (Window1, Window_Style);


-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list