PDA

View Full Version : Modify Menu Layout



Vko31
04-30-2003, 08:36 AM
Hi,

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.

Thanks.

jb_gfx
04-30-2003, 09: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

Vko31
05-05-2003, 06: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.

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

example:


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

Vko31
05-07-2003, 09: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 +).

Vko31
05-26-2003, 03: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.

faulknermano
05-28-2003, 02: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.