in reply to '0x1b03b2' Isn't Numeric

Same here, This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com Built 21:33:05 Jun 17 2002
#!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new( -title=>"Foo!", ); my $f = $mw->Frame( -width=>400, -height=>400, )->pack; $\ = "\n"; print "Tk is $Tk::VERSION; Window id is ", $f->winfo('id'); my $child = $mw->Toplevel( -title => "Bar!", -use => $f->winfo('id'), ); $child->Label( -text=>"Bar!", )->pack; MainLoop(); __END__ Tk is 800.023; Window id is 0x190274 '0x190274' isn't numeric at C:/Perl/site/lib/Tk/Widget.pm line 188. Tk::Widget::new('Tk::Toplevel', 'MainWindow=HASH(0x1ab11dc)', '-ti +tle', 'Bar!', '-use', '0x190274') called at C:/Perl/site/lib/Tk/Widge +t.pm line 247 Tk::Widget::__ANON__('MainWindow=HASH(0x1ab11dc)', '-title', 'Bar! +', '-use', '0x190274') called at foy line 19
I'm about to try it out on Tk 800.24 in the same perl 5.8.0.

Bah, forget it. This is yet another eason I say forget Tk, just use WxPerl.

jsprat: kickass. I've had similar problems when inlining images (--data). I had no idea they had to be base64 encoded. Where is this documented (i know the err kinda gives it away, but i've no idea what the module had expected, and well, looking at the source is something I forgot to do)?

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: '0x1b03b2' Isn't Numeric
by jsprat (Curate) on Aug 06, 2002 at 16:57 UTC
    So make it explicitly numeric ;) Your code almost does what I would expect... Two minor changes (see ### commented lines below, and the code works as advertised. Creates a top-level window and places the child window (bar) inside the parent window (foo).

    #!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new( -title=>"Foo!", ); ### '-container' property needs to be true my $f = $mw->Frame( -width=>400, -height=>400, -container => 1, )->pack; $\ = "\n"; print "Tk is $Tk::VERSION; Window id is ", $f->winfo('id'); ### add the following line, change the -use line below my $winfo = hex $f->winfo('id'); my $child = $mw->Toplevel( -title => "Bar!", -use => $winfo, ); $child->Label( -text=>"Bar!", )->pack; MainLoop(); __END__ output: Tk is 800.023; Window id is 0xff0344

    BTW, ++podmaster for doing the hard work