GUI Customization

The TCL and Scripts section discussed creating TCL procedures to implement new commands for X-Amin. Those procedures can be called through X-Amin's command-line, but X-Amin also provides facilities to add menus and menu entries which can then call the desired procedures.

The menu command is used to add a pulldown menu to X-Amin:

> menu -add myMenu

Menus can also be removed from X-Amin:

> menu -remove myMenu

Note that X-Amin allows you to remove any menu, not just the ones you create. If you remove a built-in menu, in will be restored when X-Amin is restarted.

> menu -remove Help

 

The menuitem command is used to add or remove items from a menu. Menu items can be added to any menu, user-created or built-in. The format for the menuitem command is:

menuitem -add|-remove <menu> <text> [<command>]

When removing a menuitem from a menu, <command> is not specified.

For example, to add an item to the new myMenu menu and call the myRead procedure:

> menuitem -add myMenu {My Read} myRead

Selected component names and selected signal names can also be included in the <command> string. This allows the user to, for example, select a signal in the Signals Window then select a user-defined command which will use the selected signal name in the command.

Component names and signal names can be inserted into the command string by including the <comp> and <sig> markers, respectively:

> menuitem -add myMenu {Special Link} {myLink <comp>}