Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
howtos:using_with_tcl_tk [2018/04/20 17:34] – debug:Windows issues; add: fossil, ornaments aplsimple | howtos:using_with_tcl_tk [2018/04/21 06:57] – typos etc. aplsimple | ||
---|---|---|---|
Line 26: | Line 26: | ||
* passing a selected text to the menu commands to process | * passing a selected text to the menu commands to process | ||
- | * the selection can be passed as underlined (" | + | * the selection can be passed as underlined (" |
* commands can be run by itself and by shell in console box | * commands can be run by itself and by shell in console box | ||
Line 32: | Line 32: | ||
* commands can be run with or without waiting their completion | * commands can be run with or without waiting their completion | ||
- | * internal command //%e %s// means " | + | * internal command //%E %s// means " |
- | * internal command //%b " | + | * internal command //%B " |
- | * internal command //%q " | + | * internal command //%Q " |
* a batch of commands can be united under a single menu item | * a batch of commands can be united under a single menu item | ||
Line 64: | Line 64: | ||
* any menu item can be assigned to ' | * any menu item can be assigned to ' | ||
- | * to ' | + | * commands that are invisible in menu may be assigned to ' |
- | * any Tcl command(s) can be assigned to ' | + | * Tcl command(s) can be assigned to ' |
* menus can be edited in Geany 'on fly' and then re-read | * menus can be edited in Geany 'on fly' and then re-read | ||
Line 78: | Line 78: | ||
* items can be run repeatedly at intervals 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 (sort of clearance) |
* there are a lot of 'look and feel' options (incl. highlighting ' | * there are a lot of 'look and feel' options (incl. highlighting ' | ||
Line 94: | Line 94: | ||
===== Context action of Geany IDE ===== | ===== Context action of Geany IDE ===== | ||
- | I try and show how the Geany context command can be used with all its beauty. | + | I try and show how the Geany context command can be used in all its beauty. |
Imagine we have a Python module under testing in Geany. And it is called with parameters. And the parameters are changed from time to time. | Imagine we have a Python module under testing in Geany. And it is called with parameters. And the parameters are changed from time to time. | ||
Line 130: | Line 130: | ||
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: |
emenu | emenu | ||
- | | + | |
- | | + | |
- | | + | |
- | run_pause.sh | + | |
- | ...etc... | + | |
into some directory, e.g. / | into some directory, e.g. / | ||
Line 209: | Line 207: | ||
|// fs=number //|size of fonts used in menu| fs=9| | |// fs=number //|size of fonts used in menu| fs=9| | ||
|// " | |// " | ||
- | |// " | + | |// " |
|// 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 12)| c=1 | | |// c=number //|index of color scheme (0 through 12)| c=1 | | ||
Line 221: | Line 219: | ||
|// g=+x+y //|sets (x,y) screen coordinates of menu| g=+700+200| | |// g=+x+y //|sets (x,y) screen coordinates of menu| g=+700+200| | ||
|// wc=1 // |centers a menu on screen|wc=1| | |// wc=1 // |centers a menu on screen|wc=1| | ||
- | |// " | + | |// " |
- | |// " | + | |// " |
|// " | |// " | ||
|// " | |// " | ||
Line 262: | Line 260: | ||
R: R: 6 | R: R: 6 | ||
R: Firefox search for " | 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 | ||
| | ||
Line 349: | Line 347: | ||
cd $curdir | cd $curdir | ||
- | 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 ' |
\\ | \\ | ||
Line 443: | Line 441: | ||
A //menu item name// can begin with //F1// through //F12// which means a hotkey F1...F12 for this name. By default, items have hotkeys //1// through //9// and //a// through //z//. For example: | A //menu item name// can begin with //F1// through //F12// which means a hotkey F1...F12 for this name. By default, items have hotkeys //1// through //9// and //a// through //z//. For example: | ||
- | RE: F1 Geany' | + | RE: F1 Geany' |
- this would display [[using_with_tcl_tk|e_menu]] that would display (after second F1) the help of Geany IDE and close. | - this would display [[using_with_tcl_tk|e_menu]] that would display (after second F1) the help of Geany IDE and close. | ||
Line 481: | Line 479: | ||
|// %u0 \\ %u1 \\ -" | |// %u0 \\ %u1 \\ -" | ||
|// %i0 \\ %i1 \\ -" | |// %i0 \\ %i1 \\ -" | ||
- | |// %b " | + | |// %B " |
- | |// %q " | + | |// %Q " |
- | |// %e file1 [file2 ...] //| calls Geany editor to edit/create //file(s)// e.g.: \\ ... to edit file(s) of Geany' | + | |// %E file1 [file2 ...] //| calls Geany editor to edit/create //file(s)// e.g.: \\ ... to edit file(s) of Geany' |
|// ''< | |// ''< | ||
|// %d //| Geany' | |// %d //| Geany' | ||
Line 558: | Line 556: | ||
| | ||
R: Firefox search for " | R: Firefox search for " | ||
- | R: Wikipedia for " | + | R: Wikipedia for " |
| | ||
MW/ Git menu MW/ " | MW/ Git menu MW/ " | ||
Line 578: | Line 576: | ||
The wildcard //%s// refers to Geany' | The wildcard //%s// refers to Geany' | ||
- | The wildcard //%q// is a query with ' | + | The wildcard //%Q// is a query with ' |
- | In // %q // command you should use edging double quotes and internal single quotes in a title and a message. Symbol \//n// stands for an empty line. | + | In // %Q // command you should use edging double quotes and internal single quotes in a title and a message. Symbol \//n// stands for an empty line. |
# git menu for e_menu | # git menu for e_menu | ||
Line 593: | Line 591: | ||
S:git add * S: git add * | S:git add * S: git add * | ||
| | ||
- | R:git commit -m " | + | R:git commit -m " |
R:git commit -m " | R:git commit -m " | ||
S:git commit -m " | S:git commit -m " | ||
| | ||
- | R:git commit -am " | + | R:git commit -am " |
R:git commit -am " | R:git commit -am " | ||
S:git commit -am " | S:git commit -am " | ||
| | ||
- | R:git log --since="1 day ago" R: cd %PD | + | R:git log "--since=1 day ago" R: cd %PD |
- | S:git log --since="1 day ago" S: git log --since="1 day ago" | + | S:git log "--since=1 day ago" S: git log "--since=1 day ago" |
| | ||
- | R:git log -p --since="1 day ago" R: cd %PD | + | R:git log -p "--since=1 day ago" R: cd %PD |
- | S:git log -p --since="1 day ago" S: git log -p --since="1 day ago" | + | S:git log -p "--since=1 day ago" S: git log -p "--since=1 day ago" |
| | ||
MW: Others MW: m=menus/ | MW: Others MW: m=menus/ | ||
Line 659: | Line 657: | ||
It's also assumed in the next sections that [[using_with_tcl_tk|e_menu]] has been unpacked into // | It's also assumed in the next sections that [[using_with_tcl_tk|e_menu]] has been unpacked into // | ||
- | Try [[using_with_tcl_tk|e_menu]] now. Set the caret on a word of your text edited in Geany IDE. You may also select a piece of text. Call //' | + | Try [[using_with_tcl_tk|e_menu]] now. Set the caret on a word of your text edited in Geany IDE. You may also select a piece of text. Call //' |
You should see the following: | You should see the following: | ||
Line 686: | Line 684: | ||
wget -r -k -l 2 -p --accept-regex=.+/ | wget -r -k -l 2 -p --accept-regex=.+/ | ||
- | Now the offline help should be ready to call. If not, check the version of your //wget// utility. You may also check // | + | Now the offline help should be ready to call. If not, check the version of your //wget// utility. |
Retry [[http:// | Retry [[http:// | ||
Line 699: | Line 697: | ||
Let's try and create a simple menu of 2 commands that would be available from Geany' | Let's try and create a simple menu of 2 commands that would be available from Geany' | ||
- | The menu file will be // | + | The menu file will be // |
* seek the selected internet pages | * seek the selected internet pages | ||
* view the selected words in a dictionary | * view the selected words in a dictionary | ||
- | Fill the // | + | Fill the // |
R/ Firefox search for " | R/ Firefox search for " | ||
Line 786: | Line 784: | ||
SW: echo %%PD is %PD SW: echo %%PD is %PD | SW: echo %%PD is %PD SW: echo %%PD is %PD | ||
| | ||
- | R: git init R: %q "Init GIT" "Are you sure to init git in\n\n%PD ?" | + | R: git init R: %Q "Init GIT" "Are you sure to init git in\n\n%PD ?" |
R: git init R: cd %PD | R: git init R: cd %PD | ||
S: git init S: git init | S: git init S: git init | ||
Line 799: | Line 797: | ||
S: git add * S: git add * | S: git add * S: git add * | ||
| | ||
- | R: git commit -am ' | + | R: git commit -am ' |
R: git commit -am ' | R: git commit -am ' | ||
S: git commit -am ' | S: git commit -am ' | ||
Line 910: | Line 908: | ||
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 " |
R:git reset --hard HEAD R: cd %PD | R:git reset --hard HEAD R: cd %PD | ||
S:git reset --hard HEAD S: git reset --hard HEAD | S:git reset --hard HEAD S: git reset --hard HEAD | ||
Line 933: | Line 931: | ||
* // %i9 // - are counters of item runs | * // %i9 // - are counters of item runs | ||
- | It's useful feature for commands that are logging or marking their data (files, directories etc.) with a current time, date and/or counter. There are 10 run counters per a menu and 4 time/date formats that can be set at call. | + | It's useful feature for commands that are logging or marking their data (files, directories etc.) with a current time, date and/or counter. There are 10 run counters per a menu and 10 time/date formats that can be set at call. |
Here is a typical example: | Here is a typical example: | ||
Line 991: | Line 989: | ||
Insert into " | Insert into " | ||
- | R: Open all R: %e readme.md wiki.txt e_help.tcl e_menu.tcl | + | R: Open all R: %E readme.md wiki.txt e_help.tcl e_menu.tcl |
... and assuming that "Open all" entry is number 8 in menu.mnu, change its call so: | ... and assuming that "Open all" entry is number 8 in menu.mnu, change its call so: | ||
Line 1022: | Line 1020: | ||
| | ||
R: Run periodic reminding of rest at 45 min interval R: ? | R: Run periodic reminding of rest at 45 min interval R: ? | ||
- | R: Run batches of commands periodically R: ? | ||
- | The last two tasks should be explained in details. The common format of periodic command is following: | + | The last task should be explained in details. The common format of periodic command is following: |
? | ? | ||
Line 1195: | Line 1192: | ||
Also, the applied tool, namely the great and awful Tcl/Tk would never stop to amaze as well. Though the first impression of Tcl is 'What a s...!' Second, third, fourth and ..th impressions are the same till one day this thing begins to tease your brains and make to wonder. | Also, the applied tool, namely the great and awful Tcl/Tk would never stop to amaze as well. Though the first impression of Tcl is 'What a s...!' Second, third, fourth and ..th impressions are the same till one day this thing begins to tease your brains and make to wonder. | ||
+ | |||
+ | An unexpected and pleasant discovery had occurred while me coding [[using_with_tcl_tk|e_menu]], | ||
And these wonders tend to become //a movable feast//. | And these wonders tend to become //a movable feast//. | ||
Line 1207: | Line 1206: | ||
More screenshots of [[using_with_tcl_tk|e_menu]]: | More screenshots of [[using_with_tcl_tk|e_menu]]: | ||
* https:// | * https:// | ||
+ | |||
+ | A sort of proposal: | ||
+ | * https:// | ||
A sort of conversation: | A sort of conversation: |