Re: [gtk-list] Re: EventBox's focus
- From: NGUYEN <htn3463 osfmail isc rit edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: EventBox's focus
- Date: Mon, 11 May 1998 21:04:32 -0400 (EDT)
Owen wrote:
> (If we are being picky, "Focus" is actually the black square
> that gets drawn around widgets when you Tab to them. This is
> just "prelight")
>
> - Set up a "enter_event" handler and a "leave_event" hander,
>
> - call:
> gtk_widget_set_events (eventbox,
> GTK_ENTER_NOTIFY_MASK | GTK_LEAVE_NOTIFY_MASK);
>
> - In the "enter_event" handler, call
>
> gtk_widget_set_state (GTK_STATE_PRELIGHT);
>
> - in the "leave_event" handler, call
>
> gtk_widget_set_state (GTK_STATE_NORMAL);
>
> I think that should do it. Regards,
> Owen
First of all, thanks for your help(You rock!..:)). The event handling works right. Unfortunately, it turned out that setting GTK_STATE_PRELIGHT makes no difference on the event widget( thats if i didnt goof off but i'm sure , i didnt). So let me brief you
on what i'm trying to accomplish here. I use the eventbox to draw a pixmap on that acts like a button(this is for a toolbar). The reason i want this is because, I do not want the border around the pixmap if I was to pack it in a button(or use GtkToolbar)
. So I thougth if i'll leave a border_width around this pixmap then set_state to get that PRELIGHT state when the mouse is moved over. It didnt work. I also tested drawing a label onto the eventbox and set the eventbox PRELIGHT, still didnt work.
I realize I could just use two pixmaps and switch back and forth. Do you have any suggestions?. Thanks in advance.
htn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]