Using conditions will just move them one by one I think and the modules you mentioned doesn’t seem to be just what I’m looking for. Maybe it’s time for me to explain myself a little better
I have an xclock, gkrellm and FvwmPager on the left side of my screen creating some sort of “toolbar”. What I would like to do is to move them to the left, out of the screen simultaneously by the press of a key and then move them back in the same way.
There are several ways to achieve that.
One is using just multiple instances on move in one function. I’m almost certain I used to do it simultaneously with just rearrange module, but I can’t seem to find the code for it now.
If the programs are swallowed inside FvwmButtons (well, I suppose even if they aren’t), you can do nice things with fakeclicks.
Key F2 A N press_fvwmbuttons1 1
# make a function to fakeclick on hider. pretty straight from FAQ
AddToFunc press_fvwmbuttons1
+ I SetEnv pointer_x $[pointer.x]
+ I SetEnv pointer_y $[pointer.y]
+ I Next (HIDE_TOOLBAR, CirculateHit) WarpToWindow
+ I FakeClick depth 1 press $0 release $0
+ I WindowId root WarpToWindow $[pointer_x]p $[pointer_y]p
# define the hider. smooth makes it slide nicely if I remember correctly
HIDE_TOOLBAR: (Panel(left,smooth,indicator 10,position Module up 0 0) \
TOOLBAR "Module FvwmButtons TOOLBAR")
TOOLBAR: (Swallow (UseOld, NoClose) "someprogram" `Exec someprogram`)
etc.
# launch the hider
Module FvwmButtons HIDE_TOOLBAR
I hope I understood it right this time
EDIT: errr… FvwmButtons, obviously, not FvwmTaskBar. Sorry about that.
Just creating an instance of FvwmButtons and use ‘AnimatedMove (NameOfFvwmButtons) ±100p keep’ seems to work.
But now I have some other questions regarding FvwmButtons instead
Is there any way to control the size of a single cell, the only thing I’ve found is ‘Size’ which only “gives the minimum space assured” (according to the man pages) and ‘ButtonGeometry’ which seems to reglate the size of all cells. The best way to control the size I’ve found so far is to create 1 column and 800 rows (my screen resolution is 1280x800) and fill the first 90 of them with xclock, the next 502 with gkrellm and so on. Is this really the best way and are there any disadvantages of doing it this way?
The third thing I want my FvwmButtons to swallow is FvwmPager. Is there a way to create a one pixel, solid color border around it? The style command doesn’t seem to apply to swallowed applications, at least the border around FvwmPager disappeared when I let FvwmButtons swallow it.
Sorry if I havn’t posted the relevant parts of my config here but the only way for me to access this wonderful forum during the weeks is using a public computer…
Quick note about the 1st question:
Say, you could have ButtonGeometry at 80x80, Rows 10, Columns 1, because it would make more sense to have xclock 1x1, grkellm 1x4, etc.
So you have a definition for a swallowed app to get a default cell size of 80x80, xclock would become 80x80, whereas gkrellm would become 80x320
While I can’t think of any disadvantages, it is a bit unclear.
You got any indication of memory size on that sucker? I’ve been reluctant to try a stunt like that for fear of exessive memory consumption. On the other hand, properly coded, the overhead should be near zero.
Anyway, I’d be interested to see the memory footprint of that monster compared with a more conventional buttonbox
I hate to disappoint you but in fact it’s just 18000 of them since all sizes were divisible by two…
Moving xclock, gkrellm and FvwmPager at the same time was no problem as soon as I figured out how FvwmButtons work. My next problem with the Pager border was solved using images. Here’s the relevant code:
Module FvwmButtons Toolbar
*Toolbar: Geometry 90x800+0+0
*Toolbar: Back $[BGCOLOR]
*Toolbar: Rows 400
*Toolbar: Columns 45
*Toolbar: (45x45, Frame 0, Swallow (UseOld, NoClose) "xclock" `Exec xclock `)
*Toolbar: (45x253, Frame 0, Swallow (UseOld, NoClose) "gkrellm2" `Exec gkrellm`)
*Toolbar: (45x1, Frame 0, Padding 0 0, Icon top_line.png)
*Toolbar: (3x100, Frame 0, Padding 0 0, Icon left_line.png)
*Toolbar: (39x100, Frame 0, Swallow (UseOld, NoClose) "FvwmPager" 'Module FvwmPager 0 3')
*Toolbar: (3x100, Frame 0, Padding 0 0, Icon right_line.png)
*Toolbar: (45x1, Frame 0, Padding 0 0, Icon bottom_line.png)
Once FvwmButtons was set up it was just to run the following function to hide the toolbar:
[code]AddToFunc ShowIcons
I All (Toolbar) AnimatedMove ±100p keep[/code]
…and a similar one to show it again.
As for the performance aspect I havn’t noticed anything special, a ‘ps aux | grep Fvwm’ shows that FvwmButtons uses less memory than FvwmIconMan and just as much as FvwmPager. Is there another/better way to get the memory usage than this?
I had been thinking of a comparison between a normal button bar, with three or four buttons, and one of your monsters. But if there was any sort of per-cell overhead then I’d expect it to show up as an order of magnitude.
Next question: how’d you stop the button box from blotting out the entire desktop. The last time I tried using a shaped panel, I had to mask it with the Shape extension.