It seems Tk should allow us to put up a widget, spawn a CLI shell
inside it, and invoke an editor. I poked around on the wiki and there
are plenty of small editors, but not what I'm looking for.
TIA,
package require Tk
frame .f -container yes
pack .f -fill both -expand yes
exec xterm -into [ winfo id .f ] -e $env(EDITOR) &
However, the xterm is not reparented into the frame on my machine. Does
anyone know what I left out?
Kind regards
Jan
exec mplayer -vo x11 -wid [ winfo id .f ] FILENAME &
Kind regards
Jan1
>
> However, the xterm is not reparented into the frame on my machine. Does
> anyone know what I left out?
In my case, when I type the commands you list, I end up with this
(sparc solaris):
% exec xterm -into [winfo id .f] -e nvi &
10333
% xterm: bad command line option "-into"
usage: xterm [-help] [-display displayname] [-geometry geom] [-/+rv]
[-bg color] [-fg color] [-bd color] [-bw number] [-fn fontset or
font name]
[-fb fontset or font name] [-iconic] [-name string] [-title
string]
[-xrm resourcestring] [-/+132] [-/+ah] [-/+ai] [-fi fontname or
fontset]
[-b number] [-/+cb] [-cc classrange] [-/+cn] [-cr color] [-/+cu]
[-/+im]
[-/+j] [-/+l] [-lf filename] [-/+ls] [-/+mb] [-mc milliseconds] [-
ms color]
[-nb number] [-/+aw] [-/+rw] [-/+s] [-/+sb] [-/+sf] [-/+si] [-/
+sk]
[-sl number] [-/+t] [-tm string] [-tn name] [-/+ut] [-/+vb] [-/
+wf]
[-e command args ...] [%geom] [#geom] [-T string] [-n string] [-C]
[-Sxxd]
Type xterm -help for a full description.
Looks like the xterm that Sun uses doesn't support -into.
It only depends on the version of the XServer, that is used. If you
use the current versions of Xorg on your Solaris-machine, then your
xterm also knows "-into", because xterm is part of X11.
The reason, why the OPs example does not work is explained in the man-
page of xterm:
"-into windowId
Given an X window identifier (a decimal integer),
xterm will reparent its top-level shell widget to that window. This
is
used to embed xterm within other applications."
It says, that the WindoID must be a decimal integer string, but [winfo
id .f] returns a hex-string. Changing the line to
exec xterm -into [expr [winfo id .f]] -e $env(EDITOR) &
solves the problem, since [expr] returns a decimal string.
HTH, regards
Stephan
This works:
exec xterm -into [expr {[winfo id .f]}] -e $env(EDITOR) &
Schelte.
--
set Reply-To [string map {nospam schelte} $header(From)]
>>
>> However, the xterm is not reparented into the frame on my machine. Does
>> anyone know what I left out?
> In my case, when I type the commands you list, I end up with this
> (sparc solaris):
> % exec xterm -into [winfo id .f] -e nvi &
It's a feature of modern xterm (Solaris delivers an antique ;-)
see
http://invisible-island.net/xterm/xterm.log.html#xterm_168
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
On the other hand, poking around I discovered /opt/sfw/bin/xterm ,
which says it is XFree 86 4.0.1c(146), which surely is newer than the
other ;-)
but "-into" was added in #168 - still more recent than #146
iirc, sunfreeware has more recent packages than that (the last I checked
it was around 200). current is #227...
Kind regards
Jan
Thanks from the OP. I will test, post, and amaze them. The rest is
implementation details.
~Lan