Skip to content

Commit

Permalink
msg corr.
Browse files Browse the repository at this point in the history
  • Loading branch information
aplsimple committed Oct 27, 2021
1 parent bd43ea5 commit 2b5dc86
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## What's that

The *aloupe v0.9.1* is a Tcl/Tk small widget / utility allowing to view the screen through a loupe.
The *aloupe v0.9.4* is a Tcl/Tk small widget / utility allowing to view the screen through a loupe.

It allows also

Expand All @@ -25,7 +25,7 @@ The *aloupe* utility runs with the command:

where `option` may be `-size, -zoom, -alpha, -background, -geometry, -ontop`.

The `Img` and `treectrl` packages have to be installed to run it. In Debian Linux the packages are titled `libtk-img` and `tktreectrl`.
The `Img` and `treectrl` packages have to be installed to run it. In Debian Linux the packages are titled `libtk-img` and `tktreectrl`. If *aloupe* is run by a *tclkit* that doesn't provide these packages, define an environment variable `TCLLIBPATH` before running *aloupe* so that `TCLLIBPATH` be a list of pathes to the packages.

There are also stand-alone [aloupe executables](https://github.com/aplsimple/aloupe/releases) for Linux / Windows.

Expand Down Expand Up @@ -58,6 +58,7 @@ The *aloupe* can be run with the options:
* `-ontop` - if *yes* (default), sets the displaying window above others
* `-save` - if *yes* (default), saves/restores the appearance settings
* `-inifile` - a file to save the settings (~/.config/aloupe.conf by default)
* `-locale` - a preferable locale (e.g., ru, ua, cz)

Some options can be used at running *aloupe* from a Tcl code:

Expand Down
27 changes: 21 additions & 6 deletions aloupe.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@
# _______________________________________________________________________ #

package require Tk
#lappend auto_path C:/ActiveTcl/lib/treectrl2.4.1
#lappend auto_path /usr/lib/treectrl2.4.1

# use TCLLIBPATH variable (some tclkits don't see it)
catch {
foreach _apave_ [lreverse $::env(TCLLIBPATH)] {
if {[lsearch -exact $::auto_path $_apave_]<0} {
set ::auto_path [linsert $::auto_path 0 $_apave_]
}
}
unset _apave_
}

package require treectrl
#lappend auto_path C:/ActiveTcl/lib/Img1.4.6
#lappend auto_path /usr/lib/tcltk/x86_64-linux-gnu/Img1.4.9
package require Img

::msgcat::mcload [file join [file dirname [info script]] msgs]

package provide aloupe 0.9.2
package provide aloupe 0.9.4

# _______________________________________________________________________ #

Expand All @@ -41,6 +49,7 @@ namespace eval ::aloupe {
-parent "" \
-save yes \
-inifile "~/.config/aloupe.conf" \
-locale "" \
]
}
}
Expand Down Expand Up @@ -557,6 +566,12 @@ proc ::aloupe::run {args} {
my::Synopsis
}
}
if {$my::data(-locale) ne {}} {
catch {
::msgcat::mcload [file join [file dirname [info script]] msgs]
::msgcat::mclocale $my::data(-locale)
}
}
catch {::apave::obj untouchWidgets "*_a_loupe_loup*"} ;# don't theme the loupe
set my::size [set my::data(PREVSIZE) $my::data(-size)]
set my::zoom [set my::data(PREVZOOM) $my::data(-zoom)]
Expand All @@ -573,5 +588,5 @@ if {[info exist ::argv0] && [file normalize $::argv0] eq [file normalize [info s
::aloupe::run {*}$::argv
}
# _________________________________ EOF _________________________________ #
#-ARGS1: -alpha .2 -background "yellow" -ontop 1 -save 1 -inifile 123 -commandname "Get"
#-ARGS1: -locale ua -alpha .2 -background "yellow" -ontop 1 -save 1 -commandname "Get"
#-RUNF1: ~/PG/github/pave/tests/test2_pave.tcl 23 9 12 "small icons"
11 changes: 11 additions & 0 deletions msgs/ua.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace eval ::aloupe {
::msgcat::mcset ua {Loupe} {Лупа}
::msgcat::mcset ua {To clipboard} {До буферу}
::msgcat::mcset ua {Save} {Зберегти}
::msgcat::mcset ua {Close} {Закрити}
::msgcat::mcset ua {Size} {Розмір}
::msgcat::mcset ua {Zoom} {Масштаб}
::msgcat::mcset ua {Save the Loupe} {Зберегти зображення}
::msgcat::mcset ua "Click the magnified image\nto get a pixel's color.\n\nThen hit this button." "Кликнить по картинці,\nщоб одержати колір піксела.\n\nПотім натиснить цю кнопку."
::msgcat::mcset ua "Click, then drag and drop\nthe loupe to get the image." "Зачепить лупу мишею та тягніть ії по екрану.\n\nКоли відпустите мишу, одержите збільшене зображення."
}
15 changes: 8 additions & 7 deletions pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

package ifneeded aloupe 0.9.2 [list source [file join $dir aloupe.tcl]]
package ifneeded aloupe 0.9.4 [list source [file join $dir aloupe.tcl]]


# A short intro (for Ruff! docs generator:)

namespace eval aloupe {

set _ruff_preamble {
The *aloupe v0.9.1* is a Tcl/Tk small widget / utility allowing to view the screen through a loupe.
The *aloupe v0.9.4* is a Tcl/Tk small widget / utility allowing to view the screen through a loupe.

It allows also

Expand All @@ -32,14 +32,14 @@ The *aloupe* utility runs with the command:

where `option` may be `-size, -zoom, -alpha, -background, -geometry, -ontop`.

The `Img` and `treectrl` packages have to be installed to run it. In Debian Linux the packages are titled `libtk-img` and `tktreectrl`.
The `Img` and `treectrl` packages have to be installed to run it. In Debian Linux the packages are titled `libtk-img` and `tktreectrl`. If *aloupe* is run by a *tclkit* that doesn't provide these packages, define an environment variable `TCLLIBPATH` before running *aloupe* so that `TCLLIBPATH` be a list of pathes to the packages.

There are also stand-alone [aloupe executables](https://github.com/aplsimple/aloupe/releases) for Linux / Windows.

The executables are started as simply as:

aloupe
aloupe.exe
aloupe ?option value ...?
aloupe.exe ?option value ...?

After the start, two windows would be displayed: a moveable loupe (at the mouse pointer) and a displaying window.

Expand All @@ -65,15 +65,16 @@ The *aloupe* can be run with the options:
* `-ontop` - if *yes* (default), sets the displaying window above others
* `-save` - if *yes* (default), saves/restores the appearance settings
* `-inifile` - a file to save the settings (~/.config/aloupe.conf by default)
* `-locale` - a preferable locale (e.g., ru, ua, cz)

Some options can be used at running *aloupe* from a Tcl code:

* `-exit` - is *false* which means "don't finish Tcl/Tk session, just close the loupe"
* `-command` - a command to be run at pressing the *To clipboard* button
* `-commandname` - a label instead of *To clipboard*; means "no clipboard"
* `-commandname` - a label instead of *To clipboard*; when set it means also "no copy to clipboard"
* `-parent` - a parent window's path (when the parent closes, its *aloupe* children do too)

From a Tcl code, *aloupe* is run this way:
From a Tcl code, *aloupe* widget is called this way:

package require aloupe
::aloupe::run ?option value ...?
Expand Down

0 comments on commit 2b5dc86

Please sign in to comment.