pd <
[email protected]> wrote:
El martes, 16 de enero de 2024 a las 21:52:20 UTC+1, Rich escribió:
pd <[email protected]> wrote:
Is there any way to insert an image in wish or any other graphic
console?
Provided said 'graphic consoles' are based off the Tk text widget, then
yes, as the text widget already supports inserting and display of Tk
images.
Ok, and how can I get the "widget" associated with the graphic
console? for example, if I run tkcon and try to get the window name
with:
winfo name .
On that I suggest you look into how the console is implemented. Tkcon
is just a Tcl/Tk script. I've not gone looking because I do my Tk
programming on Linux, where I already have a proper, real, console (xterm/rxvt/urxvt/etc.) and so I seldome ever use Tkcon. And the few
times I do it is only to connect to a running Tk instance for a quick inspection.
I get a message saying Tk is not loaded and asking me to retry the
command after loading Tk, doing so a new Tk main window named "tkcon"
appears and now tk commands refer to that window, not to the window
of Tkcon console itself.
Tkcon's probably running the console in an interpreter separate from
the one that handles Tkcon's own windows. Again, inspect the Tkcon
source, it is all just Tcl.
So assuming wish console is a Tk window itself, how can I get its
widgets and send tk commands to them?
Also, unsure. Look for the Tcl script that is lauched to make that
console and inspect how it is built to do its job. It is probably
running in a separate interpreter, so you'd need to find out the name
and then send commands into that interpreter.
If wish console is a graphic program but not a tk program, then I
suppose I have to use graphic API beneath (windows, gtk...) to
provide access to wish painting area and provide commands to interact
with it like the one you suggest to diplay an image.
Tkcon is just a Tcl/Tk script. I believe the basic 'console' that is
provided for windows builds is just a Tcl/Tk script as well. Dig into
the files installed for Tcl/Tk and see what you find.
A maybe better alternative is to program a console in Tk itself,
I.e., just what Tkcon is, and what the basic console is as well (I
believe).
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)