Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:using_with_tcl_tk [2018/04/14 07:29] – ornaments aplsimplehowtos:using_with_tcl_tk [2018/04/20 17:34] – debug:Windows issues; add: fossil, ornaments aplsimple
Line 20: Line 20:
   * calling a context help for [[http://www.tcl.tk|Tcl/Tk]] during Geany seance   * calling a context help for [[http://www.tcl.tk|Tcl/Tk]] during Geany seance
  
-  * [[http://www.tcl.tk|Tcl/Tk]] help pages can be made and called offline for quicker response+  * [[http://www.tcl.tk|Tcl/Tk]] help pages can be made and called offline for faster response
  
   * opening any number of menus containing any commands (programs) to run   * opening any number of menus containing any commands (programs) to run
Line 36: Line 36:
   * 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
Line 54: 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 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 64: Line 64:
   * 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]]
Line 76: 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 with an interval set in seconds+  * items can be run repeatedly at intervals set in seconds
  
   * [[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) 
  
-  * menu text font and font size may be set at calling +  * there are a lot of 'look and feel' options (incl. highlighting 'master' or 'dangerous' menus)
- +
-  * there are a lot of 'look and feel' options (inc. 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 are overridden by its [OPTIONS]+  * parent menu options are inherited by child menu and can be overridden by its [OPTIONS]
  
-  * [[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
Line 130: Line 128:
 Please try this: Please try this:
  
-1. If you do not have [[http://www.tcl.tk|Tcl/Tk]] on your system, install it from [[http://www.tcl.tk|www.tcl.tk]]. Linux users have it preinstalled, most likely. Though in Linux it may be necessary to install tcl-tls package or even to update Tcl to 8.6 version. On Mac [[using_with_tcl_tk|e_menu]] hasn't been tested.+1. If you do not have [[http://www.tcl.tk|Tcl/Tk]] on your system, install it from [[http://www.tcl.tk|www.tcl.tk]]. Linux users have it preinstalled, most likely. Though in Linux it may be necessary to install //tklib, tcl-tls// packages or even to update Tcl to 8.6 version. On Mac [[using_with_tcl_tk|e_menu]] hasn't been tested.
  
 2. Unpack the below attached zip to save files: 2. Unpack the below attached zip to save files:
Line 213: Line 211:
 |// "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|
Line 250: Line 248:
 |// "om=0" //| om=0 overrides the [OPTIONS] menu options \\ (by default [OPTIONS] options overcome the options defined in the call string of [[using_with_tcl_tk|e_menu]])|om=0| |// "om=0" //| om=0 overrides the [OPTIONS] menu options \\ (by default [OPTIONS] options overcome the options defined in the call string of [[using_with_tcl_tk|e_menu]])|om=0|
  
-Note: options s0..s9 and u0..u9 can include wildcards used in menu commands, e.g.:+Note: options s0..s9u0..u9, x*, y*, z* can include wildcards used in menu commands, e.g.:
  
     "s0= run #%i0 at %t2"     "s0= run #%i0 at %t2"
Line 262: Line 260:
 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?  Firefox search for "%s" R: firefox -search "%s"+    R:  R: 6 
 +    R: Firefox search for "%s" R: firefox -search "%s"
     R: Wikipedia for "%s" R:%b https://en.wikipedia.org/w/index.php?cirrusUserTesting=classic-explorer-i&search=%+     R: Wikipedia for "%s" R:%b https://en.wikipedia.org/w/index.php?cirrusUserTesting=classic-explorer-i&search=%+
     R: Open/create file(s) "%s" R:%e %s     R: Open/create file(s) "%s" R:%e %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?6?  Git  MW: m=%PN/git.mnu "u=%s" o=0 w=50+    R:  R: 6 
 +    MW: Git  MW: m=%PN/git.mnu "u=%s" o=0 w=50
     MW: Tcl/Tk    MW: m=%PN/tcltk.mnu w=20     MW: Tcl/Tk    MW: m=%PN/tcltk.mnu w=20
     MW: Python    MW: m=%PN/python.mnu w=40     MW: Python    MW: m=%PN/python.mnu w=40
Line 377: Line 377:
     <marker> name6 <marker> command6     <marker> name6 <marker> command6
     # ...     # ...
 +    
     [OPTIONS]     [OPTIONS]
     # ... options of e_menu call string     # ... options of e_menu call string
Line 872: 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:
  
-{{: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.
- 
-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 895: Line 889:
  
 {{:howtos:e_menu:danger2.png|}} {{:howtos:e_menu:danger2.png|}}
 +
 +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 "-" symbol(s) it means a visible separator, otherwise it sets a separating blank space.
 +
  
 \\ \\
Line 905: Line 910:
 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)"
Line 1177: Line 1182:
 [[http://aplsimple.ucoz.ru/misc/tcl_geany.zip|aplsimple.ucoz.ru]] [[http://aplsimple.ucoz.ru/misc/tcl_geany.zip|aplsimple.ucoz.ru]]
  
-Notice that [[using_with_tcl_tk|e_menu]] is still disposed to update. At least I would try and support its [[http://aplsimple.ucoz.ru|aplsimple.ucoz.ru]] version in a working state.+Notice that [[using_with_tcl_tk|e_menu]] is still disposed to update. At least I would try and support its [[http://aplsimple.ucoz.ru#e_menu|aplsimple.ucoz.ru]] version in a working state.
  
 \\ \\
Print/export