November 07, 2011, 17:03:19 Last Edit: November 10, 2011, 06:02:46 by mgrubert
Hi guys,

I try a kind of tweak for buttons.

In my layout I have a "Plus button" to show more buttons => it's ok :

Off :
On :

"Album button" shows widget Album
"Queue button" shows widget Queue
"Info button" shows widget Context
and they are grouped (it's Album and no Queue and no Context, or no Album and Queue and no context, or no Album and no Queue and Context)

And I want the "Close button" to : close Album or Queue or Context and put the "Plus button" off (which will close the more buttons widget).

But I can't reach this goal.

Actually the best I done is : grouping together Album, Queue, Info and Close (widget=none) and the "Close button" close Album or Queue or Context but it doesn't close the "Plus button".


If I understood correctly, this example behave like you want, the close button uses the ShowHideWidget to hide everything :
Window= hidden=Button1|Button2|Button3
HBtoggle= ToggleButton1(icon=gtk-add,widget=Button1|Button2|Button3) Button1(stock=gmb-album) Button2(stock=gmb-artist) Button3(stock=gtk-remove,activate=ShowHideWidget(Button1|Button2|Button3))


Hum, ShowHideWidget doesn't seem to work at home.
And, if I understand, your button3 only hide the buttons 1, 2 and 3, but I want him to close the widget they had show.

In french :

La fonction ShowHideWidget ne semble pas fonctionner chez moi.
Et si je comprends bien ton bouton 3 masque les boutons 1, 2 et 3 mais je voudrais aussi que le bouton 3 désactive les widgets que les boutons 1 et 2 auraient pu montrer.

I find a way :
I put the widgets associated to buttons 2 and 3 in the same contener. When I toggle button 1, it shows buttons 2 and 3 AND the contener. So when I untoggle button 1, it hides button 2 and 3 and the contener.

Off :

On (with artistinfo) :

On (with queue) :

I found a better way to do that :


Hidden : Queue|VBQueue&Context|VBMoreButton|HBButtonLess

VBQueue&Context = Queue Context

HBButton = HBButtonMore HBMoreButtons HBButtonLess

    HBButtonMore = ToggleButton1(togglegroup=1,icon=gtk-add,widget=VBQueueAndContext|HBMoreButtons|HBButtonLess,tip=_"More")
    HBMoreButtons = (togglegroup=1) \
                                ToggleButton2(togglegroup=2,icon=gmb-queue,widget=Queue,tip=_"Queue") \
                      ToggleButton3(togglegroup=2,icon=gtk-about,widget=Context,tip=_"Context")
    HBButtonLess = ToggleButton4(togglegroup=1,icon=gtk-remove,widget=HBButtonMore,tip=_"Less")

First : (HBButtonMore off)


Second : (HBButtonMore on) (you can switch between queue and context in the panel with ToggleButton2 and ToggleButton3 and HBButtonLess go back to First view)