Re: Borderless buttons



On Wed, 2004-05-26 at 17:37, ext Lars Clausen wrote:
Hi!

I'm trying to turn some image-based togglebuttons in Dia into cleaner
code.  Previously, they've just been GtkDrawingAreas with event
handling, but I'd like them to be proper ToggleButtons that change the
image according to state.  While I have the image handling in there, I
can't seem to get the six-pixel (or so) border away, making the buttons
look much clunkier than before.  Is there a way to get rid of all
borders?  Googling shows me some patches back in '99, but they don't
seem to have made it into Gtk.

I think the following should help a little:

        rcstyle = gtk_rc_style_new ();
        rcstyle->xthickness = rcstyle->ythickness = 0;
        gtk_widget_modify_style (button, rcstyle);
        gtk_rc_style_unref (rcstyle),


In addition you can also really make the button as small as possible:

        gtk_widget_size_request (image, &size);
        gtk_widget_set_size_request (button, size.width, size.height);


This is how the tab close buttons and statusbar buttons in Galeon are
done, I think they look reasonable.


-- 
Tommi Komulainen <tommi komulainen nokia com>



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