User Feedback :: A TWM for Open DSL



well I haven't given up on it entirely, since I'm making some progress.  Lua supposedly doesn't have trouble with nested quotes regardless of what type of quotes they are, but Ion apparently does have a problem with it.  I converted all the double quotes in my fluxbox menu to single quotes, and that allowed Ion to load the menu.  However, it still gives numerous errors that dont make any sense to me...I look at the line in question, and there's nothing wrong with it.  It seems like Ion guesses a lot...some of the errors it gave were in relation to nearby lines and not the line specified in the error message.

Overall, Ion has a long way to go before it's what I'd consider stable.  When you can't use certain commands in its menu its pretty much useless to me.
I'm definitely not going to bother with v3 until it gets some of these bugs fixed....so back to Ion2 I go....


/* EDIT: the more I mess around with Ion the less I like it.  It's not just the menu items.  When I first tried it I thought it was a great idea...and i still do.  Unfortunately the configuration is unnecessarily complex, with multiple files relating to what I consider to be very basic features.
The biggest annoyance I have with it is its keybindings.  First, no window manager should grab single keystrokes by default....that's just plain stupid.  Single-key bindings are for applications.  Ok, we can change that.  But in order to do it you have at least two separate files to edit.  One file defines what your Mod keys are, and another file defines what the bindings are.  Oh...and did I mention that window managers should never grab single keystrokes?
In order to use midnight commander with any sort of efficiency I have to rebind every damn F key to use a Modifier in Ion, and the keybinding in Ion3 uses an entirely different method than Ion2, so that's double the work.
Bah...humbug.   I'm going back to messing with Screen and Fluxbox.... */

You need a counter to keep track of your submenu nesting.

In other words:

You enter a submenu and set submenu_nest=1

You then enter a second (nested) submenu and set submenu_nest=submenu_net +1  (is now set to 2)

Then when you hit your first "End" you decrease the submenu_nest counter by 1

When you hit your second "End" you decrease the counter again and now it's value is 0 and you know that you are no longer nesting anymore.


Hopefully my example gets the point across. I am not a programmer, but this is my understanding of the technique used in the whitebox program.

For a better understanding, download the source code from the website and read it.

Hope this helps.

[Edit] Maybe I should read the 2nd page of the thread before replying.  At least the suggestion to download and read the whitebox source code is still relevent.

to make things a like more complicated it looks like this
Code Sample
-- Main menu
defmenu("mainmenu", {
   submenu("Programs",
     {menuentry("XTerm", make_exec_fn("xterm")),
      menuentry("emelFM", make_exec_fn("emelfm")),
      menuentry("Xmms", make_exec_fn("xmms")),
      menuentry("Dillo", make_exec_fn("dillo")),
      menuentry("Xzgv", make_exec_fn("xzgv")),
      -- The query module must also be loaded for this binding to work.
      menuentry("Run...", querylib.query_exec),}
   ),
--    menuentry("Lock screen", make_exec_fn("xlock")),
   menuentry("Help", querylib.query_man),
   menuentry("About Ion", querylib.show_aboutmsg),
   submenu("Styles", "stylemenu"),
   submenu("Exit", "exitmenu"),
})

is a valid ion-menu

as you will see the "Programs" menu is nesteted within the:mainmenu.

I've quit complaining for now :D

Yeah...that's alright, though.  Adding a submenu into the main menu is easy enough, but then you've got nested submenus inside of other submenus.  It wouldn't be so confusing except that Ion defines its submenus in a different section, so when you hit a submenu in Fluxbox, not only do you need to know where the submenu is placed but you also need to define the contents of that submenu in a different part of the menu.  That definition can also include submenu items.

I've made a tiny bit of progress today.  The nested quotes have been fixed so that they are escaped in the Ion conversion...now they don't cause errors.  However, I'm still having trouble just getting a single level of submenus to be properly written.  Many of them overlap each other, making a bit of a mess.  When I manually edit the file and move the misplaced 'defmenu' lines to their proper places the Ion menu will load with all of the submenus listed on the same level under the main menu....so I know the individual lines now have the proper syntax (except for commands which include curly braces...that's something that troubles me in other fluxbox-related scripts as well).

So next time I get back to it I'm going to start by just gettint the 'defmenu' lines and their terminators properly placed, before considering how to deal with multiple nested submenus.

Thanks for the input guys!

mikshaw -

With your bash skills I was wondering if you would be interested in creating something along the lines of MenuRank for DSL. I think the guy who created MenuRank lost interest because I haven't seen anything new for a long time. According to the site, it has a few bugs. I suggested something like this to John awhile back but not sure if he found it worth messing with. It's just a nice little utility for putting your most used programs at the top of your menu. Mainly a convenience app.

I am reading up on bash scripting but have a LONG way to go!

Chris

Next Page...
original here.