LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-31-2003, 08:18 AM   #1
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
tk script crashes?


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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
Gimp crashes suddenly LibGimp-WARNING **: script-fu: wire_read: unexpected EOF anorman Linux - Software 0 03-12-2004 12:53 PM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM
Konqueror crashes, SuseWatcher crashes!!! bruno buys Linux - Newbie 9 10-07-2003 10:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration