Code Sample |
butt[cnt]:label(k) |
Code Sample |
a,b=string.gsub(k,"_"," ") butt[cnt]:label(a) |
Code Sample |
["A t e r m"]="aterm" |
Quote |
As far as I know, DSL 4.0 uses Fluxbox 0.1.14, which I already mentioned doesn't properly position the app. Are you saying position() works now? It didn't work for me when I tried it last night (DSL 4.0RC5/Fluxbox), any better than putting the coordinates in Fl_Window did. |
Quote (^thehatsrule^ @ Oct. 26 2007,10:59) | ||
Try
|
Code Sample |
---- CONFIGURATION -- menu: label="command" (use underscores for label spaces) my_menu={ Aterm="aterm -fn proggy", Dillo="dillo", DSL_panel="cpanel.lua", Top="aterm -e top" } size=11 -- text size bh=16 -- button height bw=100 -- button width Fl:set_font(0,"snap") Fl:background(0,0,0) -- r,g,b (0-255) Fl:foreground(255,255,255) ---- END CONFIGURATION w=fltk:Fl_Window(0,0,Fl:w(),bh,"MLmenu") w:callback(function() end) butt={} cnt=0 for k,v in pairs(my_menu) do butt[cnt]=fltk:Fl_Button(cnt*bw,0,bw,bh) a,b=string.gsub(k,"_"," ") butt[cnt]:label(a) butt[cnt]:labelsize(size) butt[cnt]:callback(function() os.execute(v.." &") end) butt[cnt]:box(fltk.FL_BORDER_BOX) cnt=cnt+1 end barw=cnt*bw w:resize(Fl:w()/2-barw/2,0,barw,bh) w:border(0) w:show() Fl:run() |