Garayed.com  

Go Back   Garayed.com > Perl
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 03-07-2007, 08:12 PM
Ch Lamprecht
 
Posts: n/a
Default Re: Subroutines and Callbacks in Perl/Tk

Ben Morrow wrote:
> Quoth Michele Dondi <bik.mido@tiscalinet.it>:
>
>>On Wed, 7 Mar 2007 01:06:01 +0100, "Petr Vileta"
>><stoupa@practisoft.cz> wrote:
>>
>>
>>>use Tk;
>>>use Tk::Label;
>>>use Tk::Button;

>>
>>AFAIK (not much, really) the latter two are not necessary. (But I
>>checked and it seems like it's actually so.)

>
>
> They aren't strictly necessary: when you create a Button Tk will
> autoload Tk::Button for you. But unfortunately it gives a warning, which
> would be *very* confusing for users (or, at least, for *my* users ).


With Tk-804 this should not be the case (not with Label and Button):

use strict;
use warnings;

use Tk;
my $mw = MainWindow->new( );

$mw->$_()->pack for qw/Label Button Entry Text/;
print "but:\n";
$mw->ROText()->pack;
MainLoop;

Christoph

--
use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(J ust=>another=>Perl=>Hacker);
Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
$c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 03-08-2007, 10:57 AM
Michele Dondi
 
Posts: n/a
Default Re: Subroutines and Callbacks in Perl/Tk

On Wed, 7 Mar 2007 20:24:07 +0000, Ben Morrow <ben@morrow.me.uk>
wrote:

>> It's cool, and certainly useful. Are you a
>> PerlMonks user too? If so, then you may also post it in the snippets
>> or code sections. If not, may I do so?

>
>No, I'm not; and yes, of course you may . Could you stick a
>
> Copyright 2007 Ben Morrow

[snip]
>section at the bottom? (I should really have done so before posting...)


Done:

http://perlmonks.org/?node_id=603803

Please note that if anything is not of your liking, the node is
updateable. You can reach me by email at <ti tod nfni tod im tod mcl
ta razalb>.


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:29 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.