Calling a subroutine after widget has been displayed 
Author Message
 Calling a subroutine after widget has been displayed

Hi, All, :)

I'm trying to figure out a way to set the maximum size of my main window.
Problem is that I want the maximum size to be the initial size when the
window is first displayed.  I can't find out how to determine what this size
is.

I can't simply call

$main_w->geometry();

before

MainLoop();

because the display manager hasn't displayed my widgets and calculated their
actual size.  ->geometry() returns '1x1+0+0', which isn't useful.

So, I want a way for Perl/Tk to call a subroutine right after it's fully
displayed all of my widgets.  Is there a way to do that?

I tried binding to the 'Map' event (Mastering Perl/Tk says: "A widget has
been mapped onto the display and is visible") and the 'Visibility' event ("A
widget's visibility has changed"), but neither of my callbacks were called
even after the window was displayed.

Any ideas?  Thanks in advance!

---Jason

*****************************
This communication may contain information that is proprietary, privileged,
confidential or legally exempt from disclosure.  If you are not a named
addressee, you are notified that you are not authorized to read, print,
retain, copy or disseminate this communication without the consent of the
sender and that doing so may be unlawful. If you have received this
communication in error, please notify the sender via return e-mail and
delete it from your computer. Thank you. St. Jude Medical, Inc.
*****************************
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Sun, 27 Mar 2005 08:20:13 GMT  
 Calling a subroutine after widget has been displayed
I had exactly same problem, answer is simple. Do an update on MW.
$main_w->update;
prior to trying to get geometry. Works like a charm.
{*filter*} Penny

Quote:
----- Original Message -----


Sent: Tuesday, October 08, 2002 4:17 PM
Subject: Calling a subroutine after widget has been displayed

> Hi, All, :)

> I'm trying to figure out a way to set the maximum size of my main window.
> Problem is that I want the maximum size to be the initial size when the
> window is first displayed.  I can't find out how to determine what this
size
> is.

> I can't simply call

> $main_w->geometry();

> before

> MainLoop();

> because the display manager hasn't displayed my widgets and calculated
their
> actual size.  ->geometry() returns '1x1+0+0', which isn't useful.

> So, I want a way for Perl/Tk to call a subroutine right after it's fully
> displayed all of my widgets.  Is there a way to do that?

> I tried binding to the 'Map' event (Mastering Perl/Tk says: "A widget has
> been mapped onto the display and is visible") and the 'Visibility' event
("A
> widget's visibility has changed"), but neither of my callbacks were called
> even after the window was displayed.

> Any ideas?  Thanks in advance!

> ---Jason

> *****************************
> This communication may contain information that is proprietary,
privileged,
> confidential or legally exempt from disclosure.  If you are not a named
> addressee, you are notified that you are not authorized to read, print,
> retain, copy or disseminate this communication without the consent of the
> sender and that doing so may be unlawful. If you have received this
> communication in error, please notify the sender via return e-mail and
> delete it from your computer. Thank you. St. Jude Medical, Inc.
> *****************************
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing list
> server.  If you wish to unsubscribe from this mailing list, send the


-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Sun, 27 Mar 2005 09:57:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am having some problems with Net:SSleay AUTOLOADER and would appreciate any help

2. I am having trouble reading in a variable from a file

3. I am having a (possible) problem with crypt in perl

4. I am having a problem setting cookies in perl

5. why am I having problems with mkdir

6. Having status information displayed

7. Having trouble invoking subroutine inserting data to database

8. Having some problems integrating a C-Subroutine ...

9. Having some problems integrating a C-Subroutine ...

10. Having a problem cascading my widget

11. Why am I getting an undefined subroutine error?

12. Having a script call home

 

 
Powered by phpBB® Forum Software