Somewhere in Main application call the dirtree_sub below to choose a working area. Once user select the work area through dirtree, it will set the path in $area entry box. But when I add $dirtree_frame->destroy in dirtree_sub below, it print warning:
Useless use of reference constructor in void context at geometry_place +.pl line 564. Useless use of reference constructor in void context at geometry_place +.pl line 570.
Any idea how to solve this?
Some code in main application:
my $area = $mw->Entry(-background => "white", -foreground => "black", +-width => 51)->place(-x=>100, -y=>$ystart + 60); $area->insert('end', "$workarea"); sub dirtree_sub { if ($area->get() ne "") { $CWD = $area->get(); } else { $CWD = Cwd::cwd(); }; my $dirtree_frame = $mw->Toplevel; $dirtree_frame->title("Select work area"); my $DIR_TREE = $dirtree_frame->Scrolled('DirTree', -scrollbars => "osoe", -width => 50, -height => 25, -exportselection => 1, -browsecmd => sub {$CWD = shift}, -command => sub {\&show_cwd(); $dir +tree_frame->destroy})->pack(-fill => "both", -expa +nd => 1); $DIR_TREE->chdir($CWD); my $button_frame = $dirtree_frame->Frame()->pack(-side => "bottom" +); $button_frame->Button(-text => "Ok", -command => sub {\&show_cwd(); $dirtree_fram +e->destroy})->pack(-side => "left"); $button_frame->Button(-text => "Exit", -command => [$dirtree_frame=>'destroy'])->pa +ck(-side => "left"); }; sub show_cwd { $area->delete('0.0', 'end'); $area->insert('end', $CWD); }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |