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 06:18] – ornaments aplsimplehowtos:using_with_tcl_tk [2018/04/15 06:38] – simplified separator aplsimple
Line 11: Line 11:
  
 Below there is an attached zip file that provides this mutual helping of [[http://www.tcl.tk|Tcl/Tk]] and Geany. Below there is an attached zip file that provides this mutual helping of [[http://www.tcl.tk|Tcl/Tk]] and Geany.
 +
 +\\
  
 ===== List of features ===== ===== List of features =====
Line 18: 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 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 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 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 with an interval set in seconds+  * items can be run repeatedly at intervals set in seconds
  
-  * [[using_with_tcl_tk|e_menu]] neighbour 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 (inc. highlighting 'master' or 'dangerous' menus)
  
-  * there are several color schemes of menu (inc. highlighting 'master' or 'dangerous' menus); this option as most others may be set at calling+  * 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 if not overridden at call of it+  * 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]]+  * as an example, [[https://git-scm.com/|git]] support of Geany IDE can be easily implemented with [[using_with_tcl_tk|e_menu]]
  
   * 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://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 156: Line 161:
  
 The menu is rather simply organized and passed to [[using_with_tcl_tk|e_menu]] as "m=menu.txt" parameter. The menu is rather simply organized and passed to [[using_with_tcl_tk|e_menu]] as "m=menu.txt" parameter.
 +
 +\\
  
 ===== Calling e_menu ===== ===== Calling e_menu =====
Line 241: 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 248: Line 255:
 See also "Processing wildcards" below. See also "Processing wildcards" below.
  
 +\\
  ==== 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?  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 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 'ornament' (o=0), the last menu running 1st item at start (//tkcon// to be exact). Geany IDE is run with project files as passed parameters. This would result in the picture shown below. All menus share some options defined with environment variables (BROWSER, DIR, LEFT) while others (PROJECT, THEME, SUBJ) are supplied to //git.mnu// only for use in git commands as %s0, %s1 and %s2 wildcards. Notice that all three menus are called as topmost independent applications (t=1, &) without 'ornament' (o=0), the last menu running 1st item at start (//tkcon// to be exact). Geany IDE is run with project files as passed parameters. This would result in the picture shown below. All menus share some options defined with environment variables (BROWSER, DIR, LEFT) while others (PROJECT, THEME, SUBJ) are supplied to //git.mnu// only for use in git commands as %s0, %s1 and %s2 wildcards.
  
 +\\
  
 ===== Creating e_menu files ===== ===== Creating e_menu files =====
  
 +\\
 ==== Structure of menu ==== ==== Structure of menu ====
  
Line 365: 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 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's wildcard %p (reserved)| |// %p //| Geany's wildcard %p (reserved)|
  
 +\\
  ==== 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/git2.mnu w=40     MW: Others MW: m=menus/git2.mnu w=40
  
 +\\
  
 ===== 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'. There is only one resulting Linux screenshot below.+ 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'. There are only two resulting Linux screenshots below.
  
 +\\
 ==== Step 1. Initial testing. ==== ==== Step 1. Initial testing. ====
  
Line 677: Line 694:
 Click on the first item and you would see the [[http://www.tcl.tk|Tcl/Tk]] help on //package//. Click on the first item and you would see the [[http://www.tcl.tk|Tcl/Tk]] help on //package//.
  
 +\\
 ==== Step 2. Creating a menu. ==== ==== Step 2. Creating a menu. ====
  
Line 728: Line 746:
 {{:howtos:e_menu:p22.png|}} {{:howtos:e_menu:p22.png|}}
  
 +\\
 ==== 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, Linux screenshot only is given here.+Actually all previous considerations apply also to Linux usage of [[using_with_tcl_tk|e_menu]]. Therefore, two Linux screenshot only are given here. 
 + 
 +{{:howtos:e_menu:tcl_geany_linux.png|}} 
 + 
 +\\ 
 +\\ 
 +\\
  
 {{:howtos:e_menu:geany_tcl_linux.png|}} {{:howtos:e_menu:geany_tcl_linux.png|}}
 +
 +\\
  
 ===== 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 852: Line 881:
  
 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:
 {{: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.
 +
 +
 +\\
 ==== Warnings of menus ==== ==== Warnings of menus ====
  
Line 883: Line 918:
 - here the cancelled commands are 'cd' and 'git reset'. - here the cancelled commands are 'cd' and 'git reset'.
  
 +\\
 ==== Counting and timing commands ==== ==== Counting and timing commands ====
  
Line 908: Line 943:
     "My_function_of_all: amending N3 made at 2018-03-31_14:15:07"     "My_function_of_all: amending N3 made at 2018-03-31_14:15:07"
  
 +\\
 ==== 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 'project sensitive' ==== ==== Making menus 'project sensitive' ====
  
Line 1081: Line 1118:
 It would be convenient to have a batch of common menus that are not related to Geany's context and are called just before starting Geany IDE. Using g=+X+Y (geometry) and t=1 (stay on top) parameters you can dispose the common menus at left or right side of screen to have them at hand. And while coding in Geany IDE, you are free to use a project specific menu bound to Geany context command. It would be convenient to have a batch of common menus that are not related to Geany's context and are called just before starting Geany IDE. Using g=+X+Y (geometry) and t=1 (stay on top) parameters you can dispose the common menus at left or right side of screen to have them at hand. And while coding in Geany IDE, you are free to use a project specific menu bound to Geany context command.
  
 +\\
 ==== 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't work under Windows. However, it's worth noticing that this feature is buggy under Linux and generally doesn't work under Windows.
  
 +\\
 ==== Sort of debugging ==== ==== Sort of debugging ====
  
Line 1113: Line 1151:
  
     "a0=D starting e_menu" "a1=D start inits" "a2=D end of inits"     "a0=D starting e_menu" "a1=D start inits" "a2=D end of inits"
 +
 +\\
  
 ===== 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://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. 
 + 
 +\\
  
 ===== Acknowlegements ===== ===== Acknowlegements =====
Line 1157: Line 1201:
 Alex Plotnikov Alex Plotnikov
  
 +\\
  
 ===== See also ===== ===== See also =====
Print/export