Web lists-archives.com

Re: Simple question...


I'm writing a complex-number spinbutton widget that needs two sets of up/down buttons, and the default buttons are just too bloody huge.


On 29/06/18 22:55, Michael Gratton wrote:
On Sat, Jun 30, 2018 at 12:38 PM, Chris Moller <moller@xxxxxxxxxxxxxx> wrote:
...but I can't figure it out:  How do I make a tiny little button, like 10x10 pixels,  gtk_widget_set_size_request (button, 10, 10); doesn't work.  gtk_widget_size_allocate (GtkWidget *widget,    GtkAllocation *allocation); doesn't work.  ( can't make anything work using CSS.  Nothing seems to work.

A GtkButton is a container with a single child (see: <https://developer.gnome.org/gtk3/stable/GtkButton.html#GtkButton.object-hierarchy>), so you need to make its child's size less than 10px and then reduce the button's margin, border and padding right down as well.

But you really shouldn't do that, unless you're writing an app only yourself will use. :)


gtk-list mailing list