iMisspell has asked for the wisdom of the Perl Monks concerning the following question:
And an image to get a visual, the five r-buttons on the left are used to call the sub posted above which will retrieve the file names & paths from the sql-table and display them to the list on the right, which is where the problem is.sub setExensionFilesChk{ my $index1 = $_[0] || return ; $index1 = ($index1 -1); my $extNameIs = "$extensionNames[$index1][0]"; #print "* $extNameIs *\n"; @extensionFiles=(); @extensionFileBothInstall=(); my $q = $db->query("SELECT filelist_id, filelist_type, filelist_pa +th, filelist_file FROM filelist WHERE filelist_extension = '$extNameI +s'"); while (my $ref = $q->fetchrow_hashref() ) { #print "$$ref{'filelist_file'}\n"; push @extensionFiles, [ $$ref{'filelist_id'}, $$ref{'filelist_ +type'}, $$ref{'filelist_path'}, $$ref{'filelist_file'} ]; push @extensionFileBothInstall, [ $$ref{'filelist_id'}, $$ref{ +'filelist_type'} ]; } $extFileFrame->destroy if $extFileFrame; $extFileFrame = $fileListPane -> Frame(); $extFileFrame->configure( -width=>500, -height=>400 ); $extFileFrame -> grid(-row=>1,-column=>1,-columnspan=>3,-sticky=>" +nw"); my $names; my $i = 0; my $rdb; for $names ( @extensionFiles ) { $i++; if("@$names[1]" eq "both"){ #print "@$names[3]\n"; my $FileFrame = $extFileFrame -> Frame(); $FileFrame -> grid(-row=>($i + 1),-column=>1,-columnspan=> +3,-sticky=>"nw"); $rdb = $FileFrame -> Radiobutton(-text=>"Both", -value=>"@ +$names[0]", -variable=>"@$names[1]", -command => [ \&setFileBothInsta +ll, "@$names[0]", 'both' ]); $rdb -> select(); $rdb -> grid(-row=>(1),-column=>0, -sticky=>"w"); $rdb = $FileFrame -> Radiobutton(-text=>"Install", -value= +>"@$names[0]", -variable=>"@$names[1]", -command => [ \&setFileBothIn +stall, "@$names[0]", 'install' ]); $rdb -> deselect(); $rdb -> grid(-row=>(1),-column=>1, -sticky=>"w"); my $lab = $FileFrame -> Label(-text=>" - @$names[2]@$names +[3]"); $lab -> grid(-row=>(1),-column=>2, -sticky=>"w"); } else { } } my $lbl_extName = $extFileFrame -> Label(-text=>"($i) Extension Fi +les:"); $lbl_extName -> grid(-row=>1,-column=>0,-columnspan=>3); $extensionsFilesWindow->update; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk: Dynamic Radiobuttons toggle problem...
by keszler (Priest) on Feb 27, 2010 at 02:03 UTC | |
by iMisspell (Novice) on Feb 27, 2010 at 05:01 UTC | |
by keszler (Priest) on Feb 27, 2010 at 13:33 UTC | |
by iMisspell (Novice) on Feb 27, 2010 at 21:57 UTC | |
|
Re: Tk: Dynamic Radiobuttons toggle problem...
by stefbv (Priest) on Feb 27, 2010 at 15:35 UTC |