ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-tk
perl-tk
RE: how do I do attributes(-toolwindow=>1) in perlTk?
by Jack D. other posts by this author
Jan 16 2005 11:41AM messages near this date
how do I do attributes(-toolwindow=>1) in perlTk? | RE: how do I do attributes(-toolwindow=>1) in perlTk?
SOURCE This likely has something to do with how Windows reparents the window into a
new wrapper (seemingly at will).

See this old post I wrote for more windows weirdness:

http://groups.google.ca/groups?selm=pMFc8.72383%24A44.4272341%40news2.calgar
y.shaw.ca

Anyways - if you delay the call until after the MainLoop it works OK.

use Tk;
$mw=tkinit;
$tl=$mw-> Toplevel;
print hex($tl-> id);
$tl-> Button(-text=>'Ok')->pack;
#$tl-> attributes(-toolwindow=>1);
$mw-> after(1000,sub {$tl->attributes(-toolwindow=>1)});
MainLoop;

Jack

>  -----Original Message-----
>  From: owner-ptk@[...].EDU 
>  [mailto:owner-ptk@[...].EDU] On Behalf Of konovalo
>  Sent: January 16, 2005 10:19 AM
>  To: ptk@[...].EDU
>  Subject: how do I do attributes(-toolwindow=>1) in perlTk?
>  
>  After  reading  about -toolwindow attribute on Tcl wiki  at 
>  http://mini.net/tcl/13340 about "...- There is actually some native 
>  support in Windows for palettes via   ' wm attribute $toplevel 
>  -toolwindow 1'"
>  
>  When I trying something similar  with perlTk 804.027:
>  
>  perl -MTk -we
>  "$mw=tkinit;$tl=$mw->Toplevel;$tl->Button(-text=>'Ok')->pack;$
>  tl->attributes(-toolwindow=>1);MainLoop"
>  
>  I receive some strange error:
>  ============
>  UpdateWrapper: Failed to create container
>  
>  This application has requested the Runtime to terminate it in 
>  an unusual way.
>  Please contact the application's support team for more information.
>  ============
>  
>  Is there is something that I miss?
>  
>  BTW Tcl::Tk module gives me what I expect:
>  
>  I  do
>  perl -MTcl::Tk=:perlTk -we
>  "$mw=tkinit;$tl=$mw->Toplevel;$tl->Button(-text=>'Ok')->pack;$
>  tl->interp->call('wm','attribute',$tl,-toolwindow=>1);MainLoop"
>  
>  and I see toolbox-like window
>  
>  
>  -++**==--++**==--++**==--++**==--++**==--++**==--++**==
>  This message was posted through the Stanford campus mailing 
>  list server.  If you wish to unsubscribe from this mailing 
>  list, send the message body of "unsubscribe ptk" to 
>  majordomo@[...].edu
>  
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
Thread:
Konovalo
Jack D.
Ondrej Koala Vacha
Konovalo

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved