View Full Version : Modify Menu Layout

04-30-2003, 07:36 AM

I am searching a method to modify the Menu Layout (Layout > Interface > Edit Menu Layout ).

I want to add a custom menu in the Main Menu, so if someone could help me. I had already search in the LW SDK and LScript, but I've found anything.


04-30-2003, 08:20 PM
From within your script you must find the location of the LW's config files then code some functions to edit these files. It's not really hard since LScript has all the functions you need tho it may be a time consuming task.

Good luck

05-05-2003, 05:54 AM
you must find the location of the LW's config files

The problem is that LW haven't default config files (or I haven't found them).

To acces to the config file, I must use the Save button in the Menu Layout dialog box in order to create a config file, and then I can modify it.

Not really easy, I would like to skip this step.

05-07-2003, 03:44 AM
Use the "getDir" command with the argument "Settings" to get the path to config files.


dir_lwcfg = string(getdir("Settings"));

05-07-2003, 08:51 AM
all right i found the config file thanks to the getdir().

I have another probleme (Yes, I'm a nooby in Lscript).

I want to insert a string in a file. The problem is when i make the file.writeln("hello word") the string "hello word" is not append, but cruch the existing text.

I suppose that due to the file open mode (r, w, a and +).

05-26-2003, 02:13 AM
I'm just returning on this script, and I have found an ... irresolvable problem.

If I modify the lw3.cfg file with a L-Script program... when LW is going to be close, it rewrite it ... and so all changes I've made are lost.

05-28-2003, 01:04 AM
you can use the AddButton() and RemoveButton() funcs for layout. save out a Command List from layout and you can see the available commands.

AddButton() and RemoveButton() accepts a command and a group name. i havent tried it this yet so you may have to experiment.

otoh, if you're already going to the writing to the config file route, you may want to save out the new cfg file as a separate file and then replace it later when you quit lightwave.