water cooler :: recommend a menu



Looking good... I for one never liked the default greys.

From what I've seen, the easiest would be to implement 2 different tables...

That being said, if this was to be updated a lot, I'd implement the reading of the buttons from a external text file instead.

Quote
the easiest would be to implement 2 different tables
That had crossed my mind, and I've used that method in the past. However, it presents a greater challenge for the end user in that you need to keep track of the order of two tables instead of just one. I think it's much easier to use the label=command syntax in a single table rather than having to make sure that item 12 in table one is the appropriate label for the command specified by item 12 in table two. With the latest version of this script I no longer have to be concerned about how many items are in the table, since it uses the k and cnt variables to keep track of it while the labels and commands are being read.

One thing I don't understand is the fact that the order of the tables is not necessarily the same when the items are displayed, but I think this is a limitation of Lua. This might be one benefit of using two numerical tables.

Quote
I'd implement the reading of the buttons from a external text file instead
Also something I've considered =o)
I don't know if that's something I'll do, though. Personally I like to keep things as simple as possible, and in the case of small files simplicity means not splitting things up unnecessarily. With tiny scripts I tend to prefer keeping everything in a single file. I still haven't decided whether a split of the menu content and the script is unnecessary.

Then again, I'm not really making this for me anyway. For a minimalistic menu I still much prefer dmenu, so I can't see myself using this script for anything other than learning and future reference.

Your starting script looked simple enough, so I jumped on the chance to (finally) learn a few things :P

Quote
With the latest version of this script I no longer have to be concerned about how many items are in the table, since it uses the k and cnt variables to keep track of it while the labels and commands are being read.
Actually, I was using the for loop to keep the count... but couldn't find a function to do it then (and still not now I suppose).

Thanks again, you all went through a lot for me :)

So now it's white text on black?

I actually learned gtk+! Yay!

So now I have a gtk1 one, and this. I think I'll include both, and let the user decide :)

Next Page...
original here.