Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Always on top?

3 views
Skip to first unread message

Simon Faust

unread,
Feb 27, 2002, 8:27:10 AM2/27/02
to
Hi,
is there an easy way to align the property "allways on top" to a
toplevel window? i have a main window and several other windows. the
main window should be in background, the others on top.
Regards Simon

Cameron Laird

unread,
Feb 27, 2002, 9:17:54 AM2/27/02
to
In article <3C7CDEAE...@post.rwth-aachen.de>,

Does <URL: http://mini.net/tcl/AlwaysOnTop > help?
--

Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html

Simon Faust

unread,
Feb 27, 2002, 9:28:15 AM2/27/02
to
not really, when I use
SetWindowPos( [winfo id .op], HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE)
where .op is my toplevel window, I get "invalid command name" error. I
use Tcl 8.2 on win2000.
but I'll test the other variants now, thanks
Simon

Cameron Laird schrieb:

Rob Hegt

unread,
Feb 27, 2002, 10:23:50 AM2/27/02
to
That's because API calls are not directly available from Tcl. Maybe the one of
the dll or ffidl packages can be of help, or you use the topmost20 solution that
is lister further on in the wiki page.

Good luck,
Rob

Simon Faust <simon...@post.rwth-aachen.de> wrote in message
news:3C7CECFF...@post.rwth-aachen.de...

Simon Faust

unread,
Feb 27, 2002, 10:39:14 AM2/27/02
to
I have still downloaded it but dont know how to use it.
ciao Simon

Rob Hegt schrieb:

Rolf Schroedter

unread,
Feb 27, 2002, 10:59:22 AM2/27/02
to Simon Faust
You should use ffidl (AFAIK the dll-caller is obsolete)
and do something like:

load ffidl05.dll
ffidl::callout dll_SetWindowPos {int int int int int int int} int [ffidl::symbol user32.dll SetWindowPos]
ffidl::callout dll_FindWindowTitle {int pointer-utf8} int [ffidl::symbol user32.dll FindWindowA]

wm title . "MYWINDOW"
update idletasks
set hwnd [dll_FindWindowTitle "MYWINDOW"]
SetWindowPos $hwnd TOPMOST 0 0 100 100

Find attached a simple (but not perfect) screen saver in Tcl
using ffidl, which may give you more ideas.

Regards,
Rolf.

Simon Faust wrote:
>
> I have still downloaded it but dont know how to use it.
> ciao Simon
>
> Rob Hegt schrieb:
>
> > That's because API calls are not directly available from Tcl. Maybe the one of
> > the dll or ffidl packages can be of help, or you use the topmost20 solution that
> > is lister further on in the wiki page.
> >

---------------------------------------------------------------
Rolf Schroedter
German Aerospace Center
Institute of Space Sensor Technology and Planetary Exploration
D-12489 Berlin, Rutherfordstrasse 2
Tel/Fax: (+49) (30) 67055-416/384
Email: Rolf.Sc...@dlr.de

Martin Lemburg

unread,
Feb 27, 2002, 12:54:24 PM2/27/02
to
Simon Faust <simon...@post.rwth-aachen.de> wrote in message news:<3C7CFDA2...@post.rwth-aachen.de>...

> I have still downloaded it but dont know how to use it.
> ciao Simon

What do you mean?

Load the package into the wish:

% package require topmost 2.0
2.0

To ask for the "Always on the top"-state of the root window:

% topmost .
0

To set the "Always on the top"-state of the root window:

% topmost . 1
0

To reset the "Always on the top"-state of the root window:

% topmost . 0
1

That's all!

Have fun!

Martin Lemburg

Simon Faust

unread,
Feb 27, 2002, 6:46:16 PM2/27/02
to
Ok many thanks, now I know how to use it and it works. Unfortunately there is a new problem. I use tcl8.2 together with vtk3.2 (which requires tcl8.2), but in order to use the  topmost package, I need tcl8.3.  I may convert to vtk4.0 (that requires tcl8.3), which might be the harder alternative or find a version of topmost that works with tcl8.2.
Regards, Simon

Eric

unread,
Feb 27, 2002, 6:59:24 PM2/27/02
to
This sounded cool, so I tried it. I dloaded to my win98 sys, and copied
topmost.dll into various directories (c:/windows/system, and same dir
as where wish83.exe lives), always getting the error
can't find pachage tompmost (when running the test.tcl program).
Also tried starting up with curr dir = where all the topmost files live).

so, how does one use this?

e

Martin Lemburg

unread,
Feb 28, 2002, 4:03:23 AM2/28/02
to
Sorry, initialized the stubs with the version 8.3 instead of 8.1.

This is corrected and the "new" archives are uploaded to the ftp server.

Please download again from:

ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.all.zip
(with sources, project files, package, ... - 141kB)

ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.zip
(package only - 6.5kB)

Thanks and best regards,

Martin Lemburg

Simon Faust

unread,
Feb 28, 2002, 4:11:42 AM2/28/02
to
Put the files into tcl/lib/tcl8.x. Then it should work.
Regards, Simon

Martin Lemburg

unread,
Feb 28, 2002, 4:17:11 AM2/28/02
to
Eric <eta...@jpl.nasa.gov> wrote in message news:<3C7D72DC...@jpl.nasa.gov>...

> This sounded cool, so I tried it. I dloaded to my win98 sys, and copied
> topmost.dll into various directories (c:/windows/system, and same dir
> as where wish83.exe lives), always getting the error
> can't find pachage tompmost (when running the test.tcl program).
> Also tried starting up with curr dir = where all the topmost files live).
>
> so, how does one use this?
>
> e

This is the problem where to place packages!

Normally you have after installing tcl/tk following directory
structure:

c:\programme\tcl # variable, to be changed in the
| # installation
|
+-- bin # tcl/tk binaries (incl. DLLs)
|
+-- demos # only existent with a ActiveTcl
|
+-- doc # help files
|
+-- include # tcl/tk include files for own projects
|
+-- lib # package or library directory
|
+-- tclXY # tcl only library and version (XY)
| # depended packages
|
+-- tkXY # tk only library and version (XY)
| # depended packages
|
+-- abc # version independent package abc
|
+-- topmost # topmost package
|
| # etc.

Simply extract the archive with the contained directory name and place
the now created directory into the above mentioned lib directory
(subdirectory of the tcl installation directory)!

Ok?

Don't hesitate to ask!

Regards

Martin Lemburg

Rolf Schroedter

unread,
Mar 1, 2002, 4:39:22 AM3/1/02
to
Here is the attachment.
Sorry,

Rolf.

ScreenSaver1.tcl
0 new messages