Re: Multi-Color Buttons?



Schumi Imor wrote:
I have a button (vertically-rectangular shaped with 3 lines = shown below),
line 1: a letter, line 2: a seperator "---------" line 3: a letter. What it
the best way to make this button become multicolored where the upper half is
1 color and the bottom half is another color and then there would be no need
for a seperator?  Divide this buttom into two? or is there some API to
manipulate things at the button level? All ideas are appreciated...

The easiest solution is to pack two buttons, for example in a
vbox, with space set to 0, and then use:

gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);

so your two buttons fit together, without any visible separation.

You may also use:
gtk_widget_set_size_request (button, BUTTON_WIDTH, BUTTON_HEIGHT);

to control the button dimensions. To set the button colors, use for example gtk_widget_modify_fg|bg|base()(you can see also the Havoc's article on widget colors: http://ometer.com/gtk-colors.html)

Carlos








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