hamilton123
Technical User
I am using Perl together with a Tcl GUI interface (use Tcl::Tk). I want to bind a lot of widgets (checkbuttons) that all go by the same statement:
my $widgetVariable;
my $widgetName=$windowName->widget("widgetName");
$widgetName->configure(-variable=>\$widgetVariable);
This binds the widget $widgetName and assigns the variable $widgetVariable. Given an array of widget names (widgetName1, widgetName2,...), how can I
1. automatically declare the corresponding variables
2. automatically bind the widgets
3. automatically configure the widgets
if they all have the above structure?
Thanks for your help!
my $widgetVariable;
my $widgetName=$windowName->widget("widgetName");
$widgetName->configure(-variable=>\$widgetVariable);
This binds the widget $widgetName and assigns the variable $widgetVariable. Given an array of widget names (widgetName1, widgetName2,...), how can I
1. automatically declare the corresponding variables
2. automatically bind the widgets
3. automatically configure the widgets
if they all have the above structure?
Thanks for your help!