ok, this is the problem:
this script was just a test to access freedb.org's database, and it does taht perfectly fine. but i have in a menu item, a toplevel popup with "help" and "about". and if you open these popups before doing a search it works fine. but if you try them after you've searched the program stalls.
i thought at first that maybe it was an arangment in where Mainloop was in the code in relation to the subroutines, but i switched that up and it doesn't seem to matter.
here is the "about" subroutine. the help one is exactly the same basically except with different words
Code:
sub about
{
$t2=$main->Toplevel();
$t2->geometry();
$t2->title("about");
$about="GUI freedb.org\nwritten by anton";
$t2->Label(-text=>"$about")->pack;
}
here is (at the top of the code) the mainloop code
Code:
use WebService::FreeDB;
use Tk;
$main=MainWindow->new();
$main->title("GUI freedb lookup");
$main->geometry("600x400");
$top1=$main->Frame();
$top=$main->Frame();
$bottom=$main->Frame();
$top->grid();
$top1->grid("-");
$bottom->grid();
$menu1=$main->Menubutton
(
-text =>"File",
-menuitems=>
[
['command'=>"Clear", -command=>\&clear],
['command'=>"Exit",-command=>\&exit1]
]
);
$menu2=$main->Menubutton
(
-text => "Help",
-menuitems=>
[
['command'=>"FAQ",-command=>\&FAQ],
['command'=>"About",-command=>\&about]
]
);
$menu1->pack(-side=>"left", -anchor=>"nw");
$menu2->pack(-side=>"left", -anchor=>"nw");
$ent=$top1->Entry(-textvariable => \$info1);
$butt=$top1->Button(-text=>"search for: ",-command =>\&get_number);
$butt->pack(-side=>"left",-anchor=>"nw");
$ent->pack(-side=>"left",-anchor=>"nw");
$show=$top1->Button(-text => "show amount of entries: ",-command=>\&print_items);
$print=$top1->Entry(-textvariable=>\$number);
$show->pack(-side=>"left",-anchor=>"nw");
$print->pack(-side=>"left",-anchor=>"nw");
$text1=$bottom->Scrolled('Text',-scrollbars=>'e');
$text1->grid();
$freedb = WebService::FreeDB->new();
MainLoop;
screenshot in case that makes it clearer