From: GotToKnow on
Hello everybody,

I'm new to TCL and TK.

Would you please help me implement this basic function with TCL/TK:

I need to implement a screen snapshot simple GUI interface to "scrot"

Basicallly, to use scort from command line, I use:

scrot -s outFileName.jpg -d timeToWait

the option -s to allow selection of specific area.

I need to make simple interface for this. So that when I press a
button in my tray, this interface appears asking me to browse for the
file name (or even just type it), and another text box to write delay
in seconds. then when I press OK, it waits for the cursor will be
changed to drag a rectangle.

And after finishing, display the captured image with any image display
command (e.g. display)

Can you help me to start? Or if you've something ready?

Thank you!
Tom,
From: Batox on
Well, this is a pretty generic question. I won't answer it in detail,
because I don't want to do your job for you :)

First you should get some basic TCL/TK documentation. I personally use
"TCL and the TK toolkit" by Outerhout, mine is 16 years old but still
highly useful. The basics in particular are covered well there. After
reading the first few chapters of that book, you're ready to
understand the various online resources. Normally you should also be
able to find a basic TCL/TK tutorial online.
From: Donal K. Fellows on
On 30 July, 15:50, GotToKnow <qanonym...(a)ymail.com> wrote:
> I need to make simple interface for this. So that when I press a
> button in my tray, this interface appears asking me to browse for the
> file name (or even just type it), and another text box to write delay
> in seconds. then when I press OK, it waits for the cursor will be
> changed to drag a rectangle.

When you say "tray", I end up wondering what OS you're going to be
running on? That's the one part which isn't just conventional Tk
programming with an entry widget and tk_getOpenFile. (Well, there's
also the matter of actually doing the select and capture.)

Instead, I'll point to the Tcler's Wiki which has many useful things
in it.

http://wiki.tcl.tk/

For example, searching (with Google) for "tk tray" gives me two links
into the wiki as top hits:

http://wiki.tcl.tk/4090
http://wiki.tcl.tk/5972

And looking for "tk screen grab" gives me:

http://wiki.tcl.tk/9127

Those resources should be enough for you to be going on with for now.
(That plus Batox's good advice on general learning; you need that
too.)

Donal.