Re: a simple color question

On Apr 27, 2005, at 3:53 PM, zentara wrote:

For example in the following script, how to I set the "active hightlight color" of the blue button, i.e. when the mouse is over it?

/me runs the script

AUGH!! my eyes!! what a visual abomination! what is this, a Tk program from 1994?!?


seriously, have you heard the party line on setting widget colors yet? f2426a126839543746b99dae1a8a9fcb7250fdd1

Both of which point to

But to answer your question directly, the widget state you want it "prelight". Enumerations.html#GtkStateType

A second question is how can I change the fill color of the "control frame"? There is a hbox in the frame, but changing the hbox color does nothing.

That's because an hbox is a no-window widget, and doesn't actually draw anything. The same goes for the frame; notice you set the bgcolor of the frame to red, but the only part of the frame that is red is the outline --- which is the only thing that the frame actually draws (on its parent's window, at that).

An event box has a window, and this setting the bgcolor for it will cause something visible, but because of how children are packed into frames, you will probably find this not very visually appealing.

my $window = Gtk2::Window->new('toplevel');
$window ->signal_connect( 'destroy' => \&delete_event );
$window ->signal_connect( 'delete-event' => \&delete_event );

by the way, only one of these is needed. the default handler for delete-event destroys the window, so destroy is usually sufficient.

muppet <scott at asofyet dot org>

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