package require twoUtil
?1.0?
two_busy
TCL_BOOLEAN widget ?widgets? two_center
widget [parent] two_ct
two_invoke
widgetpath two_mb
options two_noExportImport
two_showCenter
widget [parent]
pwd
and cd
to make both of them behave like the built-in commands in
the Korn shell (ksh) or the ones in the HP-UX Posix Shell. Users might especially
want to use this if they keep getting /tmp_mnt/
on their paths.
Some background:
There are two ways to retrieve the current working directory. The one used
by tclsh is the C-Library version which basically walks up the '..
' links in
each directory to find the generic name of the current working directory.
This is unique as long as there are no symbolic links to directories:
those links make it possible to access a directory through different paths,
but the generic way to retrieve the name of the current directory will
always return the same name.
What the ksh does different now is that it
stores the user-supplied path name and returns this one on pwd
requests.
Relative cd
commands are interpreted relative to the stored pathname,
and '..
' removes the last component of the path rather than using the file
systems uplink. The replacement commands installed by two_kshPwd
apply
these semantics, which will affect, e.g., the tk_getOpenFile
commands.
Doing
it the original tclsh way gets rather annoying if you are using the automounter
on UNIX Systems: this beast will mount directories on demand and unmount
them after some idle time. The auto mounting is triggered by accessing
anything within the directory tree which should be mounted. Unfortunatly,
the automounter will set the real mount point in /tmp_mnt/
and only use
symbolic links in the place where you would expect the mount point to
live.
The problem with all that is that a /tmp_mnt/ path is not only less beautiful, but also will not trigger the re-mounting of a directory.
The
fact that there are several ways to interpret '..
' and all of them are mixed
in several places has obvously bitten almost any UNIX user at some time.
Please note that this replacement does only affect cd
and pwd
commands;
accessing a file for open
or any other command will not use these new
semantics! But then, this is the same in ksh.
tk_messageBox
which sets the parent widget to a reasonable
value.
exportSelection
none, but
disabling the importing of the seletion is a bit trickier. It is achieved
here through replacing the selection
and clipboard
commands. Caveat: You'll
have to call this function before instantiating any widget in order to
make the option
add used by this function work.
two_center
. Note that mapped
and iconified widgets are made visible, without changing their former
position, while only withrawn widgets are moved.