[Gtk-sharp-list] A Gtk.Button that looks like a Gtk.Image

Mark A. Nicolosi mark.a.nicolosi at gmail.com
Sat Mar 24 19:53:12 EDT 2007


I want a button that doesn't have a box drawn around it. Not just with no
relief, I don't want the box when the cursor is in the button either. It
should look pretty much just like a Gtk.Image. Also I want to use a lighter
image when the cursor is in the window.

Right now I'm using an EventBox with an image packed inside and have
overrided the OnEnterNotifyEvent and OnLeaveNotifyEvent methods to change
the State to State.Prelight. Then I overrided the OnStateChanged method to
change the image to a lighter version.

But I want to treat it as a Button and not an EventBox. For that to work it
has to be a sub-class of Button. Also it'd be nice if I didn't have to use
custom images for the prelighted state. Any idea how to get the desired
behavior out of Gtk.Button?

What I'm going for is something like you might see in Firefox's lower-right
hand corner if you have extensions installed (like the greasemonkey
extension) except for the prelight thing.


Mark A. Nicolosi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20070324/f6d96065/attachment.html 

More information about the Gtk-sharp-list mailing list