Re: Buttons within buttons

"Havoc Pennington" writes:

"Richard Warren" <rew primagraphics co uk> writes:

I can confirm that this problem still occurs in GTK+ V1.3.15 if that's
help!  Spin-buttons inside other buttons still can't be changed through

Owen says he did it on purpose:

 - if you have a child widget in the button such as an image,
   then clicks on the image should activate the button
 - it's quite difficult to make the button work correctly if
   child widgets can be active, because e.g. the button
   gets enter/leave events when you move into the child
 - it's weird that window and no-window widgets work differently
   as button children
 - putting other interactive widgets inside a button is not
   something most people do, and a highly dubious UI

So, it's probably this way for good.

Can I ask why you don't have the spin button _next_ to the button
instead of inside it?

I certainly agree on the first point, particularly for passive widgets such
as images, labels etc.

I have to admit that I asked myself the same question (about putting the
spin-button next to rather than inside the button) when I found that it
stopped working somewhere between V1.3.9 and V1.3.14.  Thinking about it, I
was rather surprised it ever worked but then wanted to know why it had

The original reason for putting it inside the button is rather weak.  I have
a vbox full of radio buttons, some of which have simple labels inside them
and some of which have hboxes with a label, a spin button and then another
label.  I suppose that the main benefit of doing it this way is that when
holding the mouse over the radio-button, the whole hbox is shown in the
pre-light (?) state which both adds emphasis to the visual grouping of the
labels and spin-button with the radio button and makes the appearance more
consistent (the same sized area was pre-lit as for the other radio buttons).
I think that initially I did it this way by accident and quite liked the

As it's such a weak reason and not particularly good programming (and has
now stopped working), I guess I'll do it another way!  Either putting it
next to the button, or somehow putting it below and slightly indented so it
still gives the appearance of being related to the radio-button (the value
the spin-button changes is only relevant when that radio button is

Thanks very much for looking into it anyway,

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