mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Oct. 26 2007,00:34 |
|
I tested it on dwm, swm, jwm, fluxbox 0.1.14, and fluxbox 1.0.0 (final). All of these window managers placed the app in the correct place except for fluxbox 0.1.14 (the one in DSL). I could see forced tiling being a factor, but I never thought to check that.
I made some changes to the script. It now does not cover the whole width of the screen. The width is determined by the number of buttons. The configuration is marked at the top of the file. If you use more or less than three buttons, both the size of the my_menu table and the table_size variable must be equal. I thought it was easier to have the user change table_size rather than traverse the table just to find its length (table.maxn doesn't work on non-numerical tables).
The app now appears in the top-middle of the screen if your window manager supports it. As I said it works as desired with jwm and swm. With fluxbox you will need to either use a newer version or place it manually.
The "X" button has been removed, but the w:callback is still there, so you will need to force it to close with killall or xkill or something similar.
I would like to be able to stop it from creating a toolbar button in fluxbox/jwm, but I don't know if this is possible.
Code Sample | ---- CONFIGURATION -- menu: label="command" my_menu={ Aterm="aterm -fn proggy", Dillo="dillo", DSLpanel="cpanel.lua" }
size=11 -- text size bh=16 -- button height bw=100 -- button width table_size=3 -- number of table items ---- END CONFIGURATION
barw=table_size*bw w=fltk:Fl_Window(Fl:w()/2-barw/2,0,barw,bh,"MLmenu") w:callback(function() end) butt_pack=fltk:Fl_Pack(0,0,barw,bh) butt_pack:type(fltk.FL_HORIZONTAL)
butt={} cnt=1 for k,v in pairs(my_menu) do butt[cnt]=fltk:Fl_Button(0,0,bw,bh) butt[cnt]:label(k) butt[cnt]:labelsize(size) butt[cnt]:callback(function() os.execute(v.." &") end) butt[cnt]:box(fltk.FL_BORDER_BOX) cnt=cnt+1 end
fltk:Fl_End() w:border(0) w:show() Fl:run()
|
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|