By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,248 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,248 IT Pros & Developers. It's quick & easy.

perl/Tk: how do you hide a button, then redisplay it.

P: 3

I'm new to Tk. I have 'Mastering Perl/Tk'. I want to 'place' a button, but not display it until after another button is pressed. I assumed that I could create the button, place it, placeForget it and then later in a button callback subroutine just do $mybutton -> place( ); but this doesn't work. Couldn't find any reference in the book to a placeRemember method. Did find MapWindow and UnmapWindow. Is that what I should be using?
Jan 30 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 971
It is unfortunate, but most of us here don't have experience with Perl/TK. I would suggest maybe looking into the Tk::Widget module on CPAN. If you don't get any further assistance, then I would suggest posting your question at I wish we could help more.

Feb 1 '08 #2

P: 1
Kind of Late :( I'm sorry. But this was your solution.

Expand|Select|Wrap|Line Numbers
  1. my $wm = MainWindow->new();
  2. $wm->Button(-text => "Push Me", -command => \&new)->pack();
  4. MainLoop();
  6. sub new {
  7. $wm->Button(-text =>"New Button", -command => sub { exit(1); })->pack();
  8. }
Cheers :)
Jul 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.