Home > Archive > PerlTk > January 2005 > how do I do attributes(-toolwindow=>1) in perlTk?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how do I do attributes(-toolwindow=>1) in perlTk?
|
|
| konovalo 2005-01-16, 3:57 pm |
| 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@lists.stanford.edu
| |
| Jack D. 2005-01-16, 8:57 pm |
| 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...%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@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of konovalo
> Sent: January 16, 2005 10:19 AM
> To: ptk@lists.Stanford.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@lists.stanford.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
| |
| Ondrej Koala Vacha 2005-01-16, 8:57 pm |
| On Sun, 16 Jan 2005, Jack D. wrote:
> 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...%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;
>
:( Tk804.027, perl 5.8.5, suse linux 9.2
$ perl test.pl
41943044XS_Tk__Callback_Call error:wrong # args: should be "wm attributes
window" at Tk804/Tk/Submethods.pm line 37.
Tk::Error: wrong # args: should be "wm attributes window" at
Tk804/Tk/Submethods.pm line 37.
Tk callback for wm
Tk::After::once at Tk804/Tk/After.pm line 89
[once,[{},after#2,1000,once,[\&main::__ANON__]]]
("after" script)
regards
--
Ondrej Koala Vacha
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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
| |
| konovalo 2005-01-16, 8:57 pm |
|
thanks for finding this out. Indeed, this works in a way you said.
[color=darkred]
>
>
>:( Tk804.027, perl 5.8.5, suse linux 9.2
>
>$ perl test.pl
>41943044XS_Tk__Callback_Call error:wrong # args: should be "wm attributes
>window" at Tk804/Tk/Submethods.pm line 37.
>
>
that fearure promised for Win32 only, so using such a feature not for
cross-platform scripts.
unfortunately.
because it results in nice-looking widgets
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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
| |
| Jack D. 2005-01-24, 8:57 pm |
| 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...%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@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of konovalo
> Sent: January 16, 2005 10:19 AM
> To: ptk@lists.Stanford.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@lists.stanford.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
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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
| |
| Ondrej Koala Vacha 2005-01-24, 8:57 pm |
| On Sun, 16 Jan 2005, Jack D. wrote:
> 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...%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;
>
:( Tk804.027, perl 5.8.5, suse linux 9.2
$ perl test.pl
41943044XS_Tk__Callback_Call error:wrong # args: should be "wm attributes
window" at Tk804/Tk/Submethods.pm line 37.
Tk::Error: wrong # args: should be "wm attributes window" at
Tk804/Tk/Submethods.pm line 37.
Tk callback for wm
Tk::After::once at Tk804/Tk/After.pm line 89
[once,[{},after#2,1000,once,[\&main::__ANON__]]]
("after" script)
regards
--
Ondrej Koala Vacha
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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
|
|
|
|
|