Re: Image viewing - a different approach



Dnia 22.01.2008 Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx> napisał/a:

proc link {path filename} {
button $path -text [file tail $filename] \
-command [list launch::file $filename] \
^^^^^^^^^^^^!!!

It sounds like you're asking the toolkit to deliver something you can do
yourself with just a handful of lines of code.

Not quite - because one has to know first, then setup that launch command.
And I'm wondering, if there's a way to make something "shortcut-like". When
Windows user is making "shortcut to a file", he doesn't have to know, what
command will be used to view the photo, for example. Windows knows - and
it's enough.

I would to have something, which - from the "OS's point of view" cannot be
recognized as anything different, than shortcut made directly on desktop. I
wouldn't to "exec" any programs from within TCL; I just want TCL/Tk script
to pass the parameters needed (first of all - the filename, but what then?
I'm not sure, how that "shortcuts" are working...) to the system. The system
should "think", when user clicks it: "Wow! Another nice shortcut! So, it's
a PDF file? Let's see, what application is supposed to process that file...
found it! Acroread! Sooooooo..." and then "acroread filename" follows. All
made by the OS itself, not by the script.

I can't understand: gentlemen, you really don't see the difference?

- your proposal are keeping the script as "active side"; it does - one way,
or another... - run the application (viewer, or another...)

- ...and I'm wondering, could be possible to make script "passive side";
which is just passing the needed information to OS, like the shortcuts
do - and let OS to choose associated application, then run it, pass the
filename as parameter... do all the job needed.

Just picture that following way:

1. You know the name (and location) of some file.

2. Although you know, what application could be used to do *something* to
that file - you don't care.

3. The question is: is it possible to make *something* (widget, "link"...
whatever), which will be recognized _by the OS_ as ordinary "shortcut to
file"? It's "information passing away", what is all this about.

Why does something like this need to be part of the core when it's so easy
to do with what we already have?

And did I wrote, that should it be part of the core? I'm just asking for the
solution. Yes, your proposal is "something nearby" - but it still does need
"operator intervention" to be functional.
--
ZB
.


Quantcast