Re: [gtk-list] Changing Buttons in a hbox?



Andreas Tille wrote:
> 
> Hello,
> 
> I want to do the following:
> 
> Under certain circumstances in a GtkHbox should appear three buttons
> 
>     +----------------------------------------------------------+
>     |    <button-1>       <button-2>       <button-3>          |
>     +----------------------------------------------------------+
> 
> In another state of the program only one button should be visible
> (and this button is different from the three above.
> 
>     +----------------------------------------------------------+
>     |                  <other-button>                          |
>     +----------------------------------------------------------+
> 
> The states switch depending from some user actions.  I could destroy
> the GtkButton widgets and create then new after each change including
> setting the appropriate callbacks.  But I think there must be a more
> clever solution which only hides the buttons (or removes them from the
> box and I can restore them easily when needed)

A GtkNotebook without tabs may be best. Then you just switch pages to
show the buttons you want. And a notebook always stays the same size
so it also avoids ugly resizes which could happen each time you
hide/show the buttons.

Damon




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