User-Defined Menus
User-defined menus can be set up with a similar scheme. However, it is more complex because there are no resources for specific menu entries. We must use more artificial resources to emulate this. We use menulist to name the set of menus. Then, for each of these, we define an entrylist resource. Finally, for each entry we define a few more resources. The name of the entry has to be combined with some type information, which leads to the following convention:
l_entry is the label for the entry.
t_entry is the type of the entry.
c_entry is the command associated with the entry.
v_entry is the variable associated with the entry.
m_entry is the menu associated with the entry.
Example 28-6 Specifying menu entries via resources.
*User.menulist: ... |
Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.