Panelising FvwmButtons

Hello, all -

This is probably very simple to do, but I’m tired, so… :slight_smile: I’m wanting to panelisng a FvwmButtons panel I have created. I have managed to panelise it at one end, so that pressing the button makes it slide out, and slide in. But I’d like also to have another panel button the other end of the FvwmButtons panel. Here’s what I am using at the moment, which works fine for one panel:

DestroyModuleConfig Buttons-Slider: *
*Buttons-Slider: Back gray66
*Buttons-Slider: Rows 1
*Buttons-Slider: Frame 1
*Buttons-Slider: Padding 0 0
*Buttons-Slider: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) “bar” ‘Module FvwmButtons bar’)

I tried replacating the above code, and re-swallowing “FvwmButtons bar”, but this clearly was not what I was intending. Has anyone got any ideas?

– Thomas Adam

Just copy the last line and change left to right…

*Buttons-Slider: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) “bar” ‘Module FvwmButtons barL’)
*Buttons-Slider: stuff…

*Buttons-Slider: (Panel(NoBorder, Nohints, right, steps 15, delay 6, indicator 10) “bar” ‘Module FvwmButtons barR’)

Bar will look like [<] [STUFF] [>]

Thanks for pointing out this feature… very useful.

And thank you for the reply, but I am a little lost by how I implement it. I’m not going to post the code, as that would be too large a volume, however you get the right idea. Currently I have the following:

[ Fvwm-Buttons-bar ][>]
^
(Buttons-Slider)

I want:

[<][ Fvwm-Buttons-bar][>]
^
(Buttons-Slider-2)?

The names you see above are just what I’m using currently. As before, the top-most example I currently have defined, and it is ‘Buttons-Slider’ that swallows ‘Fvwm-Buttons-Bar’. But the real problem I can’t get my head around (it’s strange – it should be easy :slight_smile: ) is what ‘Buttons-Slider-2’ should swallow so that it is able to panelise the same button. If I make it swallow ‘Fvwm-Buttons-bar’ that just swallows a new instance of it, and that’s not I want. I want it to swallow the same Fvwm-Buttons-bar.

I tried your suggestion, but either I’m missing something, or I didn’t explain things properly.

Thanks for your help.

– Thomas Adam

Ok to make

              Main Bar (Bar Main)
                      \/
[--------------] [<][Stuff][>] [ -------------]
      /\                         /\
The paneled bar (BarLeft)        ||
                                The other paneled bar (BarRight)

Now I assume you want the Left most and right most bars panneled, having both buttons shown in the center.

Try this code:
Add any theme info and real content.

DestroyModuleConfig MainBar: * 
# Config MainBar's look here
*MainBar: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarLeft" 'Module FvwmButtons BarLeft') 
#Enter other stuff you want in the main bar between the two buttons
*MainBar: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarRight" 'Module FvwmButtons BarRight') 

DestroyModuleConfig BarLeft: * 
# Define BarLeft

DestroyModuleConfig BarRight: * 
# Define BarRight

Now if you wanted to have the two side bars the same just replace BarRight with BarLeft:

DestroyModuleConfig MainBar: * 
# Config MainBar's look here
*MainBar: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarLeft" 'Module FvwmButtons BarLeft') 
#Enter other stuff you want in the main bar between the two buttons
*MainBar: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarLeft" 'nop')  # do not want to launch another instance

DestroyModuleConfig BarLeft: * 
# Define BarLeft

Finally if you wanted them to nest so that the leftmost bar, spanws the middle, then the middle spawns the rightmost:

DestroyModuleConfig BarLeft: * 
# Define BarLeft
*BarLeft: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarLeft" 'Module FvwmButtons BarMid') 

DestroyModuleConfig MidBar: * 
# Config MidBar's look here
*MidBar: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "BarRight" 'Module FvwmButtons BarRight') 

DestroyModuleConfig BarRight: * 
# Define BarRight


This gives [LEFT BAR >][MID BAR >][RIGHT BAR]

You’re going to get sick of me…

Your examples are excellent, but I can’t quite adapt them. The following URL shows my attempt thus far:

http://edulinux.homeunix.org/~n6tadam/button_bar.png

As you can see, I have the actual FvwmButton bar (“bar”), and to the right of that, is a panel which when clicked on, will slide “bar” to the right. Again, what I am wanting to do, is have another panel to the far left-hand side of the “bar” such that when I click on that, “bar” slides to the left, along with the panel (i.e. no matter which side I scroll the “bar” to, the only panel shown is the side to which it was slid to). I only have one FvwmButtons instance. I just want to be able to slide that to the left and right.

At the moment, the panel you see on the right there is defined as:

DestroyModuleConfig Buttons-Slider: *
*Buttons-Slider: Back gray66
*Buttons-Slider: Rows 1
*Buttons-Slider: Frame 1
*Buttons-Slider: Padding 0 0
*Buttons-Slider: (Panel(NoBorder, Nohints, left, steps 15, delay 6, indicator 10) "bar" ' \
Module FvwmButtons bar')

If I were then to define exactly the same panel as in the above code, but change the (Panel(…)) line to “right”, I then have the issue of not knowing what that panel should then swallow. All my attemps have lead in having to separate instances of “bar”.

I then went on to try your suggestion of, rather than having a separate panel which swallows “bar”, to just have it as another button on “bar”. This, however, caused a loop such that FvwmButtons went mental, and spawned as many instances of “bar” as my resources would allow. :slight_smile:

I hope this makes sense. I also hope (embarrassingly for me) that this has not already been answered by your previous examples. :slight_smile:

Thank you again.

– Thomas Adam

Ok, so you want to mimic KDE’s bar, right?

I don’t think you can do that with the Panel feature…

That said, you could make a pair of functions that shade the bar left or right, and have them called by buttons on the extreme bars.

Try this code:



DestroyModuleConfig Bar: *
*Bar: Padding 0 0
*Bar: Rows 1
*Bar: Columns 5
*Bar: Geometry 1560x64+20+0
*Bar: (1x1 Icon '' Action 'Exec xterm')
# Use the Main Bar you have, with any Panels removed.

# Define left button
DestroyModuleConfig BarLeft: *
*BarLeft: Geometry 20x64+0+0 # the +0+0 makes it appear in the upper left corner
*BarLeft: (1x1 Icon '$[LEFT_ICON]' Action 'HideBarLeft')

DestroyModuleConfig BarRight: *
*BarRight: Geometry 20x64-0+0 # the +0-0 makes it appear in the upper right corner
*BarRight: (1x1 Icon '$[RIGHT_ICON]' Action 'HideBarRight')

SetEnv ICON_RIGHT  ""
SetEnv ICON_LEFT   ""

DestroyFunc HideBarLeft
AddToFunc HideBarLeft
+ I SetEnv LEFT_ICON = RIGHT_ICON
+ I Style "Bar*" !NeverFocus, WindowListHit, CirculateHit
+ I Style "Bar"  TitleAtLeft
+ I Next ("Bar") 	WindowShade toggle West
+ I Next ("BarRight") 	WindowShade toggle East
+ I SetEnv RIGHT_ICON = ICON_RIGHT

DestroyFunc HideBarRight
AddToFunc HideBarRight
+ I SetEnv RIGHT_ICON = LEFT_ICON
+ I Style "Bar*" !NeverFocus, WindowListHit, CirculateHit
+ I Style "Bar"  TitleAtRight
+ I Next ("Bar") 	WindowShade toggle East
+ I Next ("BarLeft")  	WindowShade toggle West
+ I SetEnv LEFT_ICON = ICON_LEFT

DestroyFunc StartKDE_Bar
AddToFunc StartKDE_Bar
+ I Style * CirculateHitShaded
+ I Style "BarRight" TitleAtRight
+ I Style "BarLeft"  TitleAtLeft
+ I FvwmButtons Bar
+ I FvwmButtons BarLeft
+ I FvwmButtons BarRight

This is what I’ve used for what I believe is what you are trying to accomplish (and seems simpler than the last post; altho with some extra cruft)
It is very nice for screens with low-resolution, as you can swallow large portions into a small area which you can pop-up when needing to check something.

# Pressing function keys FakeClicks on desired location
Key F1 A N press_fvwmbuttons1 1
Key F2 A N press_fvwmbuttons2 1
Key F3 A N press_fvwmbuttons3 1

DestroyFunc press_fvwmbuttons1
AddToFunc press_fvwmbuttons1
+ I SetEnv pointer_x $[pointer.x]
+ I SetEnv pointer_y $[pointer.y]
+ I Next (HPG, CirculateHit) WarpToWindow
+ I FakeClick depth 1 press $0 release $0
+ I WindowId root WarpToWindow $[pointer_x]p $[pointer_y]p
# The same idea for all others...

# We initialize only the "H*(ide)" -modules, which in turn swallow the actual modules
# PG=Pager MBM=MotherBoardMonitor
Module FvwmButtons HPG
Module FvwmButtons HMBM
Module FvwmButtons HMAIL
Style "HMBM" NoHandles, BorderWidth 0, NeverFocus
Style "HMAIL" NoHandles, BorderWidth 0, NeverFocus
Style "*PG" NoHandles, BorderWidth 0, NeverFocus
Style "DA" NoHandles, NeverFocus

*DA: Padding 0 0
*DA: Columns 1
*DA: Rows 4
*DA: ButtonGeometry 85x80-0+0
*DA: (1x4, Swallow "FvwmPager" "Module FvwmPager PG 0 3")

*MAIL: Padding 0 0
*MAIL: Columns 1
*MAIL: Rows 7
*MAIL: ButtonGeometry 64x64-0+0
*MAIL: (Title received, Swallow (UseOld, Kill) "received" \
        `Exec xbiff -name received -file $[MAIL]/received`, \
        Action (Mouse 1) `Exec $[MAILPRG] -f $[MAIL]/received`)
*MAIL: (Title kkombat, Swallow (UseOld, Kill) "kkombat" \
        `Exec xbiff -name kkombat -file $[MAIL]/kk`, \
        Action (Mouse 1) `Exec $[MAILPRG] -f $[MAIL]/kk`)
# And so on...

*HMAIL: ButtonGeometry 1x570+0+0
*HMAIL: Frame 0
*HMAIL: (Padding 2, Panel(right,smooth,indicator 10,position Module up 0 0) \
        MAIL "Module FvwmButtons MAIL")

*HMBM: ButtonGeometry 3x330-0-0
*HMBM: Frame 0
*HMBM: (Padding 2, Panel(left,smooth,indicator 10,position Module up 0 0) \
        MBM "Module FvwmButtons MBM")

*MBM: Padding 0 0
*MBM: Columns 1
*MBM: Rows 4
*MBM: ButtonGeometry 150x80-0+0
*MBM: (Colorset 6, 1x1, Swallow (UseOld, NoClose) "xmbmon" `Exec xmbmon`)
*MBM: (Colorset 6, 1x3, Swallow (UseOld, NoClose) "xperfmon++" `Exec xperfmon++ 
+sysload +usercpu +systemcpu +inputpkts +outputpkts -bg "rgb:68/6b/78" -g 150x24
0 `)

*HPG: Padding 0 0
*HPG: Columns 1
*HPG: Rows 1
*HPG: ButtonGeometry 3x330-0+0
*HPG: (Padding 2, Panel(left,smooth,indicator 10,position Module up 0 0) \
        DA "Module FvwmButtons DA")

*PG: MiniIcons
*PG: Window3DBorders
*PG: Geometry 0x0-0-0
*PG: UseSkipList
*PG: Columns 1
*PG: Rows 4
*PG: DeskTopScale 20
*PG: Font none
*PG: DeskPixmap 0 pager/desk1.png
*PG: DeskPixmap 1 pager/desk2.png
*PG: DeskPixmap 2 pager/desk3.png
*PG: DeskPixmap 3 pager/desk4.png

HTH,
Mikko