K-Meleon
 

Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development

SourceForge Logo
Spam Chongqed

 

 

 

 

 

 

K-Meleon

Documentation - Reference - Menu Definition File

Introduction

The menus.cfg file is parsed top to bottom. It's only read in once. That means you have to define things above where they are used. This will make sense to programmers Everyone else,don't worry about it.

Defining Menus

1. A line that starts with # is a comment and is ignored.
Example:

# this is a comment
this is not

2. A line with a { on it starts a menu. everything before the { is the menu name (white space ignored).
Example (creates a menu called "a menu"):

a menu {

3. A line that has a } on it ends a menu. Everything else on the line is ignored.
Example:

a menu {

}

4. A line with a - on it adds a separator to the menu.
Example:

-

5. A command that starts with an @ is a special command. K-Meleon will do something special There are currently 2 special commands, @ToolBars and @entrypoint. @ToolBars will cause K-meleon to insert the list of toolbars at that location with the checkmarks so you can hide/show the toolbar. @entrypoint is an experimental command that will position the context menu at the command when it's created. Just play around with it and you'll see what I mean.  It's kind wonky right now.
Example:

Toolbars {

@ToolBars

}

6. A command that starts with a : adds a submenu to the menu. The submenu should have been defined in the file above the place it's used.
Example:

Main {

:&File

:&Edit

}

7. A command that starts with a % is a control structure. It's the beginnings of a pseudo-scripting language. Right now the only commands supported are %ifplugin, %else, %endif, %strict, and %verbose. You can use the %ifplugin and %endif commands to enable/disable certain portions of the menu depending on if a plugin is loaded or not. %strict will give you a message if there is an error in the script. %verbose gives you a lot of messages which are useful for debugging.
Example:

%strict

%ifplugin fullscreen

fullscreen(&Full Screen\tF11)

%else

Fullscreen not enabled :( = 0

%endif

8. A line that has ( and ) on it loads a plugin. Everything before the ( is taken as the plugin name. .dll is automatically appended to the plugin name. But you can add it yourself if you want. Everything between the ( and the ) is passed to the plugin. What the plugin actually does with it is anyone's guess.
Example:

bookmarks()

9. A line that has an = on it is a menu item. Everything on the left of the = is displayed on the menu. You can use \t to insert a tab such as to separate labels from the key. The thing on the right side of the = is the command id that the menu item corresponds to. It can be a number or a pre-defined command.

Example:

Exit K-Meleon = ID_APP_EXIT

Do Nothing\tAlt+N = 0

References

List of K-Meleon Command IDs: The complete list of command IDs to use with menus.

Last updated: November 21, 2001
Created: October 2, 2001

(c) 2000-2001 kmeleon.org. All rights reserved.
design by splif.