Open Source Development Tutorials | Newsletter Signup | About Us
Search  

Go Back   Open Source Tutorials Forum > Programming Languages > Perl Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-18-2006, 03:06 PM
Mallow Mallow is offline
Junior Member
 
Join Date: Sep 2006
Posts: 1 Mallow is on a distinguished road
Default Perl Tk widget access question

Hi.

Somewhat new to Perl Tk, and trying to understand where the master list of widgets is. For example,

my $newwidget = $mw->label()
my $alsonewwidget = $mw->notebook()
access_widgets();
MainLoop;

sub access_widgets {
$newwidget->configure(-foreground => 'red')
$alsonewwidget->configure(-foreground => 'blue')

}

-------
The above won't work because the widgets fall out of scope. It seems to be forcing me to sweep every little widget into the called function in order to touch it.

It seems like there should be a way to make widgets global so that they can be accessed anywhere even if not passed as parameters to the called function.

Does anybody know how to make this work?

Thanks in advance.
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
Forum Jump



All times are GMT -5. The time now is 05:58 PM.


Powered by: vBulletin Version 3.0.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright 2004 - 2006 GrindingGears.com. All Rights Reserved.