Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (6) </ 1 2 3 [4] 5 6 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: recommend a menu, /app launcher/panel/...< Next Oldest | Next Newest >
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: Oct. 26 2007,13:32 QUOTE

I haven't still tested, but I won't be using fluxbox, I'll be using failsafewm.

Sorry to repeat, but is it possible to have spaces in the buttons' text?
Like "Web browser"="/usr/bin/dillo"


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 26 2007,13:41 QUOTE

Replace this:
Code Sample
butt[cnt]:label(k)

with this:
Code Sample
a,b=string.gsub(k,"_"," ")
butt[cnt]:label(a)

Now use underscores for spaces in the table and they will be converted to spaces.

I couldn't find a way to use the spaces directly in the table keys.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: Oct. 26 2007,14:59 QUOTE

Try
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.
Yea, I was just confirming the position problems but that I didn't run into any window decoration problems.  Using position() works for any other values than 0,0 and it does seem that the settings in Fl_Window are ignored.  Of course, I haven't thoroughly tested all cases...
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 26 2007,18:53 QUOTE

Quote (^thehatsrule^ @ Oct. 26 2007,10:59)
Try
Code Sample
["A t e r m"]="aterm"

Hey, that works. I dunno what it means, but it works =o)
But I think I prefer my method, though. It's easier to use a single underscore for each space, in my opinion, than to use square brackets and quotes *and* spaces.

I also think I'll add a little code to automatically get the proper number of table entries instead of having the user change both, contrary to what I said before. It's only a few extra lines, and it won't make any noticeable difference in performance even on a very slow machine unless you have hundreds of keys (which wouldn't fit on the screen anyway).

With either of the above issues, I would consider keeping the code smaller if it weren't for the fact that the script is so small that the ease of use and configuration greatly outweighs the added code.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 26 2007,21:41 QUOTE

Added font and color config
Automated the table item count
Added suport for spaces in labels
Removed the Fl_Pack (not needed in a linear array of same-size buttons)
Changed the way the window is positioned (w:resize())
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()


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
26 replies since Oct. 21 2007,14:40 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (6) </ 1 2 3 [4] 5 6 >/
reply to topic new topic new poll
Quick Reply: recommend a menu

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code