Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:using_with_tcl_tk [2018/04/14 06:18] – ornaments aplsimple | howtos:using_with_tcl_tk [2018/04/20 17:34] – debug:Windows issues; add: fossil, ornaments aplsimple | ||
---|---|---|---|
Line 11: | Line 11: | ||
Below there is an attached zip file that provides this mutual helping of [[http:// | Below there is an attached zip file that provides this mutual helping of [[http:// | ||
+ | |||
+ | \\ | ||
===== List of features ===== | ===== List of features ===== | ||
Line 18: | Line 20: | ||
* calling a context help for [[http:// | * calling a context help for [[http:// | ||
- | * [[http:// | + | * [[http:// |
* opening any number of menus containing any commands (programs) to run | * opening any number of menus containing any commands (programs) to run | ||
Line 34: | Line 36: | ||
* internal command //%q " | * internal command //%q " | ||
- | * a batch of commands can be under one menu item | + | * a batch of commands can be united |
* 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 | ||
Line 52: | Line 54: | ||
* menu items can be bound to hotkeys F1-F12 (by default they are bound to 1-9a-z) | * menu items can be bound to hotkeys F1-F12 (by default they are bound to 1-9a-z) | ||
- | * menu items and their underlying commands can include up to 9 counters of runs per a menu | + | * menu items and their underlying commands can include up to 10 counters of runs per a menu |
* menu items and their underlying commands can be supplied with current date/time | * menu items and their underlying commands can be supplied with current date/time | ||
Line 62: | Line 64: | ||
* any menu item can be assigned to ' | * any menu item can be assigned to ' | ||
- | * to ' | + | * to ' |
* any Tcl command(s) can be assigned to ' | * any Tcl command(s) can be assigned to ' | ||
Line 74: | Line 76: | ||
* [[using_with_tcl_tk|e_menu]] can be started with a pause to delay its initialization | * [[using_with_tcl_tk|e_menu]] can be started with a pause to delay its initialization | ||
- | * items can be run repeatedly | + | * items can be run repeatedly |
- | * [[using_with_tcl_tk|e_menu]] | + | * [[using_with_tcl_tk|e_menu]] |
- | * menu text font and font size may be set at calling | + | * there are a lot of ' |
- | * there are several color schemes of menu (inc. highlighting ' | + | * the options |
- | * parent menu options are inherited by child menu if not overridden | + | * parent menu options are inherited by child menu and can be overridden |
- | * [[https:// | + | * for an easy exercise, |
* encoding of menus is utf-8 | * encoding of menus is utf-8 | ||
+ | \\ | ||
===== Context action of Geany IDE ===== | ===== Context action of Geany IDE ===== | ||
Line 114: | Line 117: | ||
By this we don't touch Run settings of other Python modules. | By this we don't touch Run settings of other Python modules. | ||
+ | |||
+ | \\ | ||
===== Introduction to e_menu ===== | ===== Introduction to e_menu ===== | ||
Line 123: | Line 128: | ||
Please try this: | Please try this: | ||
- | 1. If you do not have [[http:// | + | 1. If you do not have [[http:// |
2. Unpack the below attached zip to save files: | 2. Unpack the below attached zip to save files: | ||
Line 156: | Line 161: | ||
The menu is rather simply organized and passed to [[using_with_tcl_tk|e_menu]] as " | The menu is rather simply organized and passed to [[using_with_tcl_tk|e_menu]] as " | ||
+ | |||
+ | \\ | ||
===== Calling e_menu ===== | ===== Calling e_menu ===== | ||
Line 204: | Line 211: | ||
|// " | |// " | ||
|// 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 | + | |// c=number //|index of color scheme (0 through |
|// o=number // | |// o=number // | ||
|// | |// | ||
Line 241: | Line 248: | ||
|// " | |// " | ||
- | Note: options s0..s9 | + | Note: options s0..s9, u0..u9, x*, y*, z* can include wildcards used in menu commands, e.g.: |
"s0= run #%i0 at %t2" | "s0= run #%i0 at %t2" | ||
Line 248: | Line 255: | ||
See also " | See also " | ||
+ | \\ | ||
==== Setting options in a menu file ==== | ==== Setting options in a menu file ==== | ||
Most options of a call string can be set in [OPTIONS] section of a menu file, e.g. : | Most options of a call string can be set in [OPTIONS] section of a menu file, e.g. : | ||
- | R:?6? | + | R: |
+ | R: Firefox search for " | ||
R: Wikipedia for " | R: Wikipedia for " | ||
R: Open/create file(s) " | R: Open/create file(s) " | ||
R: geany: edit all R: geany readme.md wiki.txt e_help.tcl e_menu.tcl | R: geany: edit all R: geany readme.md wiki.txt e_help.tcl e_menu.tcl | ||
| | ||
- | | + | |
+ | MW: Git MW: m=%PN/ | ||
MW: Tcl/ | MW: Tcl/ | ||
MW: Python | MW: Python | ||
Line 285: | Line 294: | ||
And vice versa, if you want to have a specific menu iron bound to some project, include into its [OPTIONS] the //PD=, PN=// and //om=1//. | And vice versa, if you want to have a specific menu iron bound to some project, include into its [OPTIONS] the //PD=, PN=// and //om=1//. | ||
+ | \\ | ||
==== Examples ==== | ==== Examples ==== | ||
Line 341: | Line 351: | ||
Notice that all three menus are called as topmost independent applications (t=1, &) without ' | Notice that all three menus are called as topmost independent applications (t=1, &) without ' | ||
+ | \\ | ||
===== Creating e_menu files ===== | ===== Creating e_menu files ===== | ||
+ | \\ | ||
==== Structure of menu ==== | ==== Structure of menu ==== | ||
Line 365: | Line 377: | ||
< | < | ||
# ... | # ... | ||
+ | | ||
[OPTIONS] | [OPTIONS] | ||
# ... options of e_menu call string | # ... options of e_menu call string | ||
Line 447: | Line 459: | ||
where $ escaped as \$, CLI commands devided with \n. | where $ escaped as \$, CLI commands devided with \n. | ||
+ | \\ | ||
==== Wildcards in menu names and commands ==== | ==== Wildcards in menu names and commands ==== | ||
Line 479: | Line 491: | ||
|// %p //| Geany' | |// %p //| Geany' | ||
+ | \\ | ||
==== Processing wildcards ==== | ==== Processing wildcards ==== | ||
Line 527: | Line 540: | ||
"s1= Theme 1" "s2= Theme 1.2" "s3= Theme 1.2.3" "s4= Theme 1.2.3.4" | "s1= Theme 1" "s2= Theme 1.2" "s3= Theme 1.2.3" "s4= Theme 1.2.3.4" | ||
+ | \\ | ||
==== Examples ==== | ==== Examples ==== | ||
Line 596: | Line 609: | ||
MW: Others MW: m=menus/ | MW: Others MW: m=menus/ | ||
+ | \\ | ||
===== Using e_menu ===== | ===== Using e_menu ===== | ||
Line 631: | Line 645: | ||
You can use the right and the left arrow keys for calling and closing a submenu respectively. | You can use the right and the left arrow keys for calling and closing a submenu respectively. | ||
+ | |||
+ | \\ | ||
===== Detailed example ===== | ===== Detailed example ===== | ||
- | The following example illustrates step by step how to create and use [[using_with_tcl_tk|e_menu]] in Windows. Linux version is mostly the same and even more simple than Windows' | + | The following example illustrates step by step how to create and use [[using_with_tcl_tk|e_menu]] in Windows. Linux version is mostly the same and even more simple than Windows' |
+ | \\ | ||
==== Step 1. Initial testing. ==== | ==== Step 1. Initial testing. ==== | ||
Line 677: | Line 694: | ||
Click on the first item and you would see the [[http:// | Click on the first item and you would see the [[http:// | ||
+ | \\ | ||
==== Step 2. Creating a menu. ==== | ==== Step 2. Creating a menu. ==== | ||
Line 728: | Line 746: | ||
{{: | {{: | ||
+ | \\ | ||
==== Step 3. Creating a submenu. ==== | ==== Step 3. Creating a submenu. ==== | ||
Line 797: | Line 815: | ||
First items only echo the options passed to [[using_with_tcl_tk|e_menu]]. Echos are useful for debugging btw. Other items refer to GIT system so that they would be working if you had installed GIT. | First items only echo the options passed to [[using_with_tcl_tk|e_menu]]. Echos are useful for debugging btw. Other items refer to GIT system so that they would be working if you had installed GIT. | ||
+ | \\ | ||
==== Usage in Linux ==== | ==== Usage in Linux ==== | ||
- | Actually all previous considerations apply also to Linux usage of [[using_with_tcl_tk|e_menu]]. Therefore, | + | Actually all previous considerations apply also to Linux usage of [[using_with_tcl_tk|e_menu]]. Therefore, |
+ | |||
+ | {{: | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
{{: | {{: | ||
+ | |||
+ | \\ | ||
===== Tips and hints ===== | ===== Tips and hints ===== | ||
+ | \\ | ||
==== What's all those R, RE, RW, S, SE, SW, M, ME, MW mean? ==== | ==== What's all those R, RE, RW, S, SE, SW, M, ME, MW mean? ==== | ||
Line 817: | Line 845: | ||
** W ** stands for //wait for completion of action// | ** W ** stands for //wait for completion of action// | ||
+ | \\ | ||
==== Changing menus' look and feel ==== | ==== Changing menus' look and feel ==== | ||
Line 843: | Line 872: | ||
* 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: |
- | {{: | + | {{: |
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): | ||
- | {{: | + | {{: |
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. | ||
- | |||
- | You can use a special form of item name to set a separator before it, namely: | ||
- | |||
- | R: ?N? name R: command | ||
- | |||
- | where ?N? contains a number negative to set a visible separator (e.g. ?-5?) or positive to set a separating empty space (e.g. ?5?). The N number sets a vertical size of separator. | ||
The dangerous and irrevocable commands may be collected under a red menu as big as a monitor screen, e.g.: | The dangerous and irrevocable commands may be collected under a red menu as big as a monitor screen, e.g.: | ||
Line 867: | Line 890: | ||
{{: | {{: | ||
+ | You can use a special form of menu item name to set a separator, namely: | ||
+ | |||
+ | R: R: N | ||
+ | | ||
+ | or | ||
+ | | ||
+ | R: -- R: N | ||
+ | |||
+ | where N sets a vertical size of separator. If the item name contains " | ||
+ | |||
+ | |||
+ | \\ | ||
==== Warnings of menus ==== | ==== Warnings of menus ==== | ||
Line 875: | Line 910: | ||
Here the Tcl commands are used to exit and close the dangerous menu possibly open by mistake. Q is a query with " | Here the Tcl commands are used to exit and close the dangerous menu possibly open by mistake. Q is a query with " | ||
- | When calling a menu item, you can use //%q " | + | When calling a menu item, you can use //%q " |
R:git reset --hard HEAD R: %q " | R:git reset --hard HEAD R: %q " | ||
Line 883: | Line 918: | ||
- here the cancelled commands are ' | - here the cancelled commands are ' | ||
+ | \\ | ||
==== Counting and timing commands ==== | ==== Counting and timing commands ==== | ||
Line 908: | Line 943: | ||
" | " | ||
+ | \\ | ||
==== Running commands at start ==== | ==== Running commands at start ==== | ||
Line 963: | Line 999: | ||
That's all. Minus a special start of Geany in batch file. Plus a useful menu command that allows __to restore your project file list__ in Geany IDE. | That's all. Minus a special start of Geany in batch file. Plus a useful menu command that allows __to restore your project file list__ in Geany IDE. | ||
+ | \\ | ||
==== Starting menu items at intervals ==== | ==== Starting menu items at intervals ==== | ||
Line 1055: | Line 1091: | ||
You may desire to stop this periodical stuff manually. Just call it again and [[using_with_tcl_tk|e_menu]] would stop it on your confirmation. | You may desire to stop this periodical stuff manually. Just call it again and [[using_with_tcl_tk|e_menu]] would stop it on your confirmation. | ||
+ | \\ | ||
==== Making menus ' | ==== Making menus ' | ||
Line 1081: | Line 1118: | ||
It would be convenient to have a batch of common menus that are not related to Geany' | It would be convenient to have a batch of common menus that are not related to Geany' | ||
+ | \\ | ||
==== Closing all menus ==== | ==== Closing all menus ==== | ||
Line 1094: | Line 1131: | ||
However, it's worth noticing that this feature is buggy under Linux and generally doesn' | However, it's worth noticing that this feature is buggy under Linux and generally doesn' | ||
+ | \\ | ||
==== Sort of debugging ==== | ==== Sort of debugging ==== | ||
Line 1113: | Line 1151: | ||
"a0=D starting e_menu" | "a0=D starting e_menu" | ||
+ | |||
+ | \\ | ||
===== Issues ===== | ===== Issues ===== | ||
Line 1129: | Line 1169: | ||
You should take this into account, being aware of this behaviour of Geany. | You should take this into account, being aware of this behaviour of Geany. | ||
+ | |||
+ | \\ | ||
===== Downloading ===== | ===== Downloading ===== | ||
Line 1140: | Line 1182: | ||
[[http:// | [[http:// | ||
- | Notice that [[using_with_tcl_tk|e_menu]] is still disposed to update. At least I would try and support its [[http:// | + | Notice that [[using_with_tcl_tk|e_menu]] is still disposed to update. At least I would try and support its [[http:// |
+ | |||
+ | \\ | ||
===== Acknowlegements ===== | ===== Acknowlegements ===== | ||
Line 1157: | Line 1201: | ||
Alex Plotnikov | Alex Plotnikov | ||
+ | \\ | ||
===== See also ===== | ===== See also ===== |