Re: bitmap buttons



Paul Davis wrote:
> >> Related question...  If I add a 10x10 pixel wide pixmap to a button, will
> >> the button request a size of 10x10 or is there some implicit border?  Just
> >> in case, hypothetically I wanted to tile a region with buttons containing
> >> pixmaps... ;-)
> >
> >Hi Skip, no, I think there's a 1 pixel non-removable border (in gtk-1.2.x
> >anyway). You'd need to write your own widget for a tiled clickable area. I gue
> >ss
> >subclassing off DrawingArea would be the easiest (100 lines of C?).
> 
> i don't think so. this should do it:
> 
> GtkWidget *evbox = gtk_event_box_new ();
> GtkWidget *pixmap = gtk_pixmap_new (...);
> gtk_container_add (evbox, pixmap);
> gtk_widget_set_events (evbox, GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);

*cough* yes, that would work too.

John



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