Problems with toplevels 
Author Message
 Problems with toplevels

Hi all,

I have some questions about handling toplevel windows.

If I start wish.exe with a tcl file which creates a GUI an annoying console
window (where tcl send its output) is opened and stayes open. How can I
remove/hide this window?

If I open a second window w1 (a second toplevel, not a modal dialog) this
window goes to the background if the mouse pointer is moved out of this
window. How do I have to configure the toplevel to stay on top of the
main window w0 even if the mouse is moved out. w1 can not be
modal, as the user should be able to minimize it and continue working
in the main window w0.

I have tried wm transient $w1 $w0, but this is not exactly what I want.
The window w1 is closed/minimized when the main window is. That
is ok. But w1 always stays on top of w0 and can not be minimized
or maximized separately.
I have searched the wiki but didn't find a solution to my problem.
Is it possible to achieve this toplevel behavior (kind of MDI) with Tcl
at all?

Thanks in advance for your help,
Roger



Wed, 10 Dec 2008 05:33:52 GMT  
 Problems with toplevels

Quote:

> Hi all,

> I have some questions about handling toplevel windows.

> If I start wish.exe with a tcl file which creates a GUI an annoying console
> window (where tcl send its output) is opened and stayes open. How can I
> remove/hide this window?

Are you certain this is a console, or is it just a blank window? It's
unusual for a console to appear if you run wish.exe with a filename.

However, on windows  you can hide the console with "console hide", and
show it with "console show". Is it possible that your script has a
"console show" somewhere that you don't know about?

Quote:

> If I open a second window w1 (a second toplevel, not a modal dialog) this
> window goes to the background if the mouse pointer is moved out of this
> window. How do I have to configure the toplevel to stay on top of the
> main window w0 even if the mouse is moved out. w1 can not be
> modal, as the user should be able to minimize it and continue working
> in the main window w0.

If I understand what you are asking, the default behavior of toplevels
is a) what you want, and b) apparently not what you are getting. That
leads me to believe your code is changing the default behavior. Is that
possible?

In other words, it's reasonable to expect to be able to create multiple
independent toplevel windows that do _not_ automatically goes to the
background. To get it to go to the background you generally have to
explicitly add in that behavior.

What version of wish are you running? Is this from the ActiveState
distribution, one you built yourself, or something else entirely?

--
Bryan Oakley
http://www.tclscripting.com



Wed, 10 Dec 2008 05:45:13 GMT  
 Problems with toplevels
Hi Bryan,

Thanks for your reply.

The problems mentioned happen when using vtk.exe (version 5.0) which is
based on tcl 8.4.5 and statically includes the packages of the vtk
libraries. The main window is a packed BWidget Mainframe , the second is a
tk toplevel widget (not packed).

The "console" I see is just a blank window (no prompt, etc.).

An simple test program has shown me, that the desired behavior is indeed the
default. So I don't understand, why my windows behave in a different way.
The test showed me other issues I don't understand.
I have tried to start the test program in different ways:
- wish.exe -> source test.tcl                           shows the expected
behavior
- vtk.exe -> source test.tcl                             shows the expected
bahavior
- wish.exe test.tcl                                           shows "can't
find package vtk" -> dynamic libraries are not installed
- vtk.exe test.tcl                                             show the
expected behavior
- Start "wish.exe test.tcl" with windows link    show the expected behavior
- Start "vtk.exe test.tcl" with windows link      This shows the blank
window!!

I am sure there is no intentional code to create the shown behavior.
Any idea what could cause the window to be put in the back? Could a "focus
follows mouse" be the reason, i.e. is that what "focus follows mouse" does?

I have already posted to the vtk newsgroup, but didn't get an answer so far.
I will try again, as it seems to be rather vtk related than tcl itself.

Thanks again,
Roger



Quote:

>> Hi all,

>> I have some questions about handling toplevel windows.

>> If I start wish.exe with a tcl file which creates a GUI an annoying
>> console
>> window (where tcl send its output) is opened and stayes open. How can I
>> remove/hide this window?

> Are you certain this is a console, or is it just a blank window? It's
> unusual for a console to appear if you run wish.exe with a filename.

> However, on windows  you can hide the console with "console hide", and
> show it with "console show". Is it possible that your script has a
> "console show" somewhere that you don't know about?

>> If I open a second window w1 (a second toplevel, not a modal dialog) this
>> window goes to the background if the mouse pointer is moved out of this
>> window. How do I have to configure the toplevel to stay on top of the
>> main window w0 even if the mouse is moved out. w1 can not be
>> modal, as the user should be able to minimize it and continue working
>> in the main window w0.

> If I understand what you are asking, the default behavior of toplevels is
> a) what you want, and b) apparently not what you are getting. That leads
> me to believe your code is changing the default behavior. Is that
> possible?

> In other words, it's reasonable to expect to be able to create multiple
> independent toplevel windows that do _not_ automatically goes to the
> background. To get it to go to the background you generally have to
> explicitly add in that behavior.

> What version of wish are you running? Is this from the ActiveState
> distribution, one you built yourself, or something else entirely?

> --
> Bryan Oakley
> http://www.tclscripting.com



Wed, 10 Dec 2008 09:27:45 GMT  
 Problems with toplevels

Quote:

> Hi Bryan,

> Thanks for your reply.

> The problems mentioned happen when using vtk.exe (version 5.0) which is
> based on tcl 8.4.5 and statically includes the packages of the vtk
> libraries. The main window is a packed BWidget Mainframe , the second is a
> tk toplevel widget (not packed).

> The "console" I see is just a blank window (no prompt, etc.).

> An simple test program has shown me, that the desired behavior is indeed the
> default. So I don't understand, why my windows behave in a different way.
> The test showed me other issues I don't understand.
> I have tried to start the test program in different ways:
> - wish.exe -> source test.tcl                           shows the expected
> behavior
> - vtk.exe -> source test.tcl                             shows the expected
> bahavior
> - wish.exe test.tcl                                           shows "can't
> find package vtk" -> dynamic libraries are not installed
> - vtk.exe test.tcl                                             show the
> expected behavior
> - Start "wish.exe test.tcl" with windows link    show the expected behavior
> - Start "vtk.exe test.tcl" with windows link      This shows the blank
> window!!

Perhaps your 'windows link' is incorrect with respect to quoting and/or
arguments passed to vtk.exe. When you get the blank window, do you also
get the regular window, or do you get just the one blank window? If you
just get the one window, it appears that vtk.exe isn't seeing the
"test.tcl" argument.

It appears that "vtk.exe test.tcl" works as expected, so the question to
be answered is, how is starting with the windows link different than
starting with 'vtk.exe text.tcl'.

Quote:

> I am sure there is no intentional code to create the shown behavior.
> Any idea what could cause the window to be put in the back? Could a "focus
> follows mouse" be the reason, i.e. is that what "focus follows mouse" does?

"focus follows mouse" doesn't raise or lower windows, it merely assigns
focus to a window whether it is raised or not.

--
Bryan Oakley
http://www.tclscripting.com



Thu, 11 Dec 2008 01:51:26 GMT  
 Problems with toplevels
Hi Bryan,

Quote:

> Perhaps your 'windows link' is incorrect with respect to quoting and/or
> arguments passed to vtk.exe. When you get the blank window, do you also
> get the regular window, or do you get just the one blank window? If you
> just get the one window, it appears that vtk.exe isn't seeing the
> "test.tcl" argument.

> It appears that "vtk.exe test.tcl" works as expected, so the question to
> be answered is, how is starting with the windows link different than
> starting with 'vtk.exe text.tcl'.

Quoting seems to be correct as wish.exe and vtk.exe recognize the parameter
(test.tcl). In both cases I get a GUI window. With vtk.exe I just get the
additional
blank window. I have checked once more: if I start vtk.exe from the Windows
Explorer (open with .. on test.tcl, then select vtk.exe) I don't get the
extra window.
So to me this rather seems to be a Windows related issue than Tcl or vtk.

Thanks again for your help,
Roger



Sun, 14 Dec 2008 07:49:27 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Problem - Modal toplevels that mess up the focus

2. Tkinter: Relative positioning of Toplevels

3. Tix buttons in Toplevels don't work under Python 1.5

4. TKinter toplevels

5. Getting a list of *all* toplevels

6. Working with toplevels

7. Geometry of toplevels

8. Determining the stacking order of sibling widgets (not toplevels)

9. Uncontrolled deiconification of toplevels when switching workspaces

10. Grouping Toplevels in Linux Taskbar

11. rasing toplevels in WinDoze environment!

12. removing toplevels from windows taskbar?

 

 
Powered by phpBB® Forum Software