Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
howtos:using_with_tcl_tk [2018/04/15 06:38] – simplified separator aplsimple | howtos:using_with_tcl_tk [2018/04/20 17:34] – debug:Windows issues; add: fossil, ornaments aplsimple |
---|
* internal command //%q "title" "message %s"// means "ask a confirmation, possibly with selected text" | * internal command //%q "title" "message %s"// means "ask a confirmation, possibly with selected text" |
| |
* a batch of commands can be under one menu item | * a batch of commands can be united under a single menu item |
| |
* any command can be confirmed, with message box of title and text including Geany selection | * any command can be confirmed, with message box of title and text including Geany selection |
* any menu item can be assigned to 'autorun' at start of [[using_with_tcl_tk|e_menu]] (submenus including) | * any menu item can be assigned to 'autorun' at start of [[using_with_tcl_tk|e_menu]] (submenus including) |
| |
* to 'autorun' may be assigned commands that are invisible in menu (submenus excluding) | * to 'autorun' may be assigned commands that are invisible in menu (submenus including) |
| |
* any Tcl command(s) can be assigned to 'autorun' at start of [[using_with_tcl_tk|e_menu]] | * any Tcl command(s) can be assigned to 'autorun' at start of [[using_with_tcl_tk|e_menu]] |
* [[using_with_tcl_tk|e_menu]] neighboring applications can be killed with two keystrokes (well fit to clear) | * [[using_with_tcl_tk|e_menu]] neighboring applications can be killed with two keystrokes (well fit to clear) |
| |
* there are a lot of 'look and feel' options (inc. highlighting 'master' or 'dangerous' menus) | * there are a lot of 'look and feel' options (incl. highlighting 'master' or 'dangerous' menus) |
| |
* the options may be set at calling of [[using_with_tcl_tk|e_menu]] and/or in [OPTIONS] section of a menu | * the options may be set at calling of [[using_with_tcl_tk|e_menu]] and/or in [OPTIONS] section of a menu |
* parent menu options are inherited by child menu and can be overridden by its [OPTIONS] | * parent menu options are inherited by child menu and can be overridden by its [OPTIONS] |
| |
* as an example, [[https://git-scm.com/|git]] support of Geany IDE can be easily implemented with [[using_with_tcl_tk|e_menu]] | * for an easy exercise, [[https://git-scm.com/|git]] as well as [[http://fossil-scm.org|fossil]] support of Geany IDE can be implemented with [[using_with_tcl_tk|e_menu]] |
| |
* encoding of menus is utf-8 | * encoding of menus is utf-8 |
|// "f2=font" //|name of font used in menu entries| "f1=Liberation Mono"| | |// "f2=font" //|name of font used in menu entries| "f1=Liberation Mono"| |
|// w=number //|width of menu items (in characters)| w=30 | | |// w=number //|width of menu items (in characters)| w=30 | |
|// c=number //|index of color scheme (0 through 11)| c=1 | | |// c=number //|index of color scheme (0 through 12)| c=1 | |
|// o=number //|'ornament' (view mode)|o=0 - no header, no prompts shown \\ o=1 - header only shown (default) \\ o=2 - prompts only shown \\ o=3 - both prompts and header shown| | |// o=number //|'ornament' (view mode)|o=0 - no header, no prompts shown \\ o=1 - header only shown (default) \\ o=2 - prompts only shown \\ o=3 - both prompts and header shown| |
|//bd=number //|sets a border width of menu items|bd=0 - minimum \\ bd=1| | |//bd=number //|sets a border width of menu items|bd=0 - minimum \\ bd=1| |
* c=0 - sets an index of color scheme; 0 is default. | * c=0 - sets an index of color scheme; 0 is default. |
| |
The following colors are available from c=0 to c=11: | The following colors are available from c=0 to c=12: |
| |
{{:howtos:e_menu:c0.png?70|}} {{:howtos:e_menu:c1.png?70|}} {{:howtos:e_menu:c2.png?70|}} {{:howtos:e_menu:c3.png?70|}} {{:howtos:e_menu:c4.png?70|}} {{:howtos:e_menu:c5.png?70|}} {{:howtos:e_menu:c6.png?70|}} {{:howtos:e_menu:c7.png?70|}} {{:howtos:e_menu:c8.png?70|}} {{:howtos:e_menu:c9.png?70|}} {{:howtos:e_menu:c10.png?70|}} {{:howtos:e_menu:c11.png?70|}} | {{:howtos:e_menu:c0.png?70|}} {{:howtos:e_menu:c1.png?70|}} {{:howtos:e_menu:c2.png?70|}} {{:howtos:e_menu:c3.png?70|}} {{:howtos:e_menu:c4.png?70|}} {{:howtos:e_menu:c5.png?70|}} {{:howtos:e_menu:c6.png?70|}} {{:howtos:e_menu:c7.png?70|}} {{:howtos:e_menu:c8.png?70|}} {{:howtos:e_menu:c9.png?70|}} {{:howtos:e_menu:c10.png?70|}} {{:howtos:e_menu:c11.png?70|}} {{:howtos:e_menu:c3.png?70|}} |
| |
and their shadowed counterparts (3rd scheme is of special highlight as you see): | and their shadowed counterparts (3rd scheme is of special highlight as you see): |
| |
{{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c3h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c5h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} | {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c3h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c5h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} {{:howtos:e_menu:c0h.png?70|}} |
| |
5th color scheme can be used to open a potentially dangerous menu, e.g. containing some irrevocable commands. | 5th color scheme can be used to open a potentially dangerous menu, e.g. containing some irrevocable commands. |
Here the Tcl commands are used to exit and close the dangerous menu possibly open by mistake. Q is a query with "head" and "message" that can contain the above mentioned wildcards. Q returns 'false' if answered 'Cancel' so that 'exit' Tcl command closes the menu. | Here the Tcl commands are used to exit and close the dangerous menu possibly open by mistake. Q is a query with "head" and "message" that can contain the above mentioned wildcards. Q returns 'false' if answered 'Cancel' so that 'exit' Tcl command closes the menu. |
| |
When calling a menu item, you can use //%q "head" "message"// in a command batch. It's the same query with that difference that [[using_with_tcl_tk|e_menu]] stops the batch of commands after answering 'Cancel'. For example: | When calling a menu item, you can use //%q "head" "message"// in a command batch. It's the same query with the difference that [[using_with_tcl_tk|e_menu]] stops the batch of commands after answering 'Cancel'. For example: |
| |
R:git reset --hard HEAD R: %q "RESET" "This cancels the last uncommitted changes and resets to the last commited state!\n\nDo you want to RESET ?\n\n(VERY LIKELY IT'S CANNOT BE UNDONE)" | R:git reset --hard HEAD R: %q "RESET" "This cancels the last uncommitted changes and resets to the last commited state!\n\nDo you want to RESET ?\n\n(VERY LIKELY IT'S CANNOT BE UNDONE)" |