water cooler :: recommend a menu



Thanks Mik. There's though one flaw with that; it appeared in the middle of the screen (vertically)..
edit: I was running on my main machine when I tested; it might appear on top when on DSL. I'll test soon.

I think I might try to learn gtk+ programming. But that might never happen, so I could also use this :)

Quote
it appeared in the middle of the screen
I think it depends on your window manager, since it is scripted to appear at 0,0 and that's all I can do with murgaLua. Some window managers will ignore a request for specific placement, and some will put it wherever the app wants to go. It might be doable with an overlay or GL window, but neither is supported by murgaLua.

I have two wishes: could that close button (x) in the left corner be left out?
And could the buttons be centered?

Just from a quick look...
1. delete the 3 lines that start with 'close'
2. no idea if there's an easy centering call, but this might be fine..
[Line 13] butt_pack=fltk:Fl_Pack(INSERT_LEFT_MARGIN_HERE,0,Fl:w(),bh)
where you could use something like (Fl:w()/2)-(50*ARRAY_SIZE)
where ARRAY_SIZE=3 from the original... where there might be a function to easily obtain this value

Quote
it appeared in the middle of the screen (vertically)..
Try using [Line 31] w:position(1,1)
Maybe (0,0) would be as if position() was not called at all? (So the WM takes over control)

Quote
1. delete the 3 lines that start with 'close'
If you remove the close button, you might also want to remove the w:callback, since it is what prevents the application from closing when Esc is pressed. I did this simply because I assumed you wouldn't want the menu to be so easy to close.

The placement of the buttons was just the first way that came to mind. I thought that using the whole screen width was unnecessary, but used it in case you wanted to add more buttons. I've never been good with math, but it looks like thehats' suggestion should work at least as well as anything I'd come up with. I also don't recall seeing anything specific to placement of one object within another, but it could be there somewhere.

Quote
Maybe (0,0) would be as if position() was not called at all?
Maybe, but I still think it's a window manager issue. 0,0 works for me. I haven't tried it with Fluxbox or JWM yet.

Next Page...
original here.