Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl TK Window Management

Status
Not open for further replies.

clueo8

Programmer
Jun 13, 2005
47
US
Is there a way to have a modal window within a main window?

What I mean is a child window of another, where you cannot click on any other window (sort of like how it is when you have a dialog box)...

I'm creating all these new windows in my program and I don't want users to go to previous ones.
 
Look up the withdraw method as it will make the window disappear, but I believe you can make it reappear when you need it. It is a hiding technique.


Michael Libeson
 
I was able to use $widget->withdraw to hide the window and $widget->popup to show the window. One draw back is that it doesn't remember the position of the window on the screen. It moves slightly, not too noticible, but slightly.

I have these show/hide command on buttons, but my main problem is if a user clicks the X on the window bar and closes the window, the program hangs, and runs with hidden windows! Is there a way to disable to capture this event?
 
To handle the position use:

$current_geometry = $mw->geometry;

In order to save the window geometry and then configure it when you pop the window:

$mw->pop;
$mw->geometry($current_geometry);

This should pop th window in its orignal size and position.

As for hiding the window manager, I was not able to find or remember how I had done it before. It has been maybe 10 - 15 years since I have hidden a window manager. Sorry.



Michael Libeson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top