**<> markup** To add a page written in [doctools] to the Wiki, you have the following options: * Type it in again using Wikit markup * Convert it to Wikit markup using the [doctools] to Wiki converter * Add the page written in [doctools] markup to the Wiki surrounded by `<>` lines Changes within the `<>` blocks are only visible in word compares, not in line compares and edit summary. Here below the [menubar - A command that creates menubar objects%|%menubar] man page is included using the `<>` markup. **Manpage** ---- <> [comment {-*- tcl -*- doctools manpage}] [manpage_begin menubar n 0.5] [copyright "2009 Tom Krehbiel All rights reserved."] [titledesc "Creates an instance of the [emph menubar] Class."] [moddesc {Create and manipulate a menubar}] [require Tcl 8.6] [require Tk 8.6] [require menubar [opt 1.0]] [description] [list_begin definitions] [call [cmd {menubar new}] [opt options]] [list_end] [para] Create and return a new instance of the menubar class. The menubar class encapsulates the definition, installation and dynamic behavior of a menubar. The class doesn't depend on a widget framework and therefore can be used with or without a frameworks (e.g. Bwidget, IWidget, Snit, etc.). Unlike other Tk widget commands, the menubar command doesn't have a [emph pathName] argument because it is a feature of the display manager and not a Tk widget. [section {STANDARD OPTIONS}] The following standard options can be used when creating a menubar instance. The effect of these options is platform specific. [list_begin options] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-activebackground -activebackground]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-activeborderwidth -activeborderwidth]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-activeforeground -activeforeground]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-background -background]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-borderwidth -borderwidth]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-cursor -cursor]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-disabledforeground -disabledforeground]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-font -font]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-foreground -foreground]] [opt_def [uri http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/options.htm#M-relief -relief]] [list_end] [section INTRODUCTION] [para] An instance of the menubar class provides methods for compiling a description of the menubar, configuring the items in the menu and installing the menubar in toplevel windows. A menubar can be thought of as a tree of cascading menus. Users define a menubar using a language that results in a human readable description of a menubar. The description of the menubar is then compiled by an instance of the menubar class and can then be installed in one or more toplevel windows. By default a menubar instance is kept syncronized in all toplevel windows where it is installed which means the state of radio buttons, checkboxs, etc. are the same for all installed toplevel windows. The menubar class provides many unique capabilities that are not found in other tcl/tk menubar implementation. Some of these are: [list_begin itemized] [item] A tagging system that simplifies access to menu entries in the menu tree. [item] Automatic management of state variables for checkbuttons and radiobuttons. [item] Namespace support for all callback commands so callback commands can be easily grouped into namespaces. [item] Support for menubar syncronization across multiple toplevel windows. [item] A simplifed and uniform interface for all callback commands. [item] A simplified method for creating radio buttons. [item] Support for hidding and exposing menu items on the menubar. [item] Support for user defined tags that depend on the toplevel window context. [item] Management of tearoff menus. [item] Support for user defined menu entries. [item] Support for saving and restoring user defined menu entries. [list_end] [section TERMINOLOGY] [list_begin definitions] [def MENUBAR] The visible rendering of a menubar in a toplevel window is a horizontally group of cascading Tk menus. [def MENU] A menu is an ordered list of items that is rendered vertially. Menus are not visible until a user preforms some action (normally a event). A menu may contain any number of child menu's that are rendered as cascading menus. Cascading menus are rendered next to the parent menu when they are activated. [def {MENU ENTRY}] A menu contains an ordered list of items called menu entries. Menu entries have a type and the menubar class supports the following 6 entry types: [emph Command], [emph Checkbutton], [emph Radiobutton], [emph Separator], [emph Group] and [emph Menu]. [def {ENTRY LABEL}] Each menu entry has a visible string that is called the entry label. [def {TAGS}] Tags are names that are used when refering to items in the menu tree or window. A tag name is an alphanumeric character string that may include the underscore character. Menu tree tags are defined for all nodes and leafs in a menu tree. This provides a flat abstraction of the tree and simplifies item referancing in the menubar methods. Without this abstraction it would be necessary to reference menu elements using a tree path which could change at runtime. The menubar class also has a method that can create a user defined tag that are window dependent. User defined tags store values that change based on the currently active toplevel window. These tags can store widget pathnames for use by callback code so that output can be routed to the appropreate toplevel window. [list_end] [section METHODS] [list_begin definitions] [call [arg mBarInst] [cmd define] [arg body]] Compiles [emph body] into a tree of menu entries which define the visual layout of the menubar. The [emph body] argument describes the layout using the following syntax where the elements of the syntax are described below. [para] [emph {body == definitions}] [example_begin] definitions ::= { | | } ignore ::= { | | # } definition ::= { | | | | | } command ::=