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

message box

P: 17
this my piece of code.after pop up 1st msg box.it is not worked.even though i give 'yes' it s not working..pls help me.any mistake..

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3. use Tk;
  4.  
  5.  
  6.  my $mw = MainWindow->new;
  7.         $mw->geometry("600x475");
  8.         $mw->title("Network Device Monitoring tool");
  9.  
  10. $mw->Button(-text =>"Refresh",-command =>\&a)->pack(-ipadx => 5,-ipady => 4,-padx => 10,-pady => 15,-side =>"left",-expand
  11.         =>"no");
  12.  
  13. sub a {
  14. my $response = $mw -> messageBox(-message=>"Go to Properties of this mac?",-title=>"string",-type=>'yesno',-icon=>'question');
  15.  
  16. if ($response eq 'yes')
  17. {
  18.     $mw -> messageBox(-message=>"Go to Properties of this mac?",-title=>"string",-type=>'ok',-icon=>'info');
  19. }
  20. else {
  21.     exit;
  22. }
  23. }
  24. MainLoop;
Nov 5 '08 #1
Share this Question
Share on Google+
2 Replies


nithinpes
Expert 100+
P: 410
First, use Code tags while posting your code.
The script does not work because the messagebox call returns 'Yes' and not 'yes'. Change:
Expand|Select|Wrap|Line Numbers
  1. if ($response eq 'yes')
  2.  
to :

Expand|Select|Wrap|Line Numbers
  1. if ($response eq 'Yes')
  2.  
-Nithin
Nov 5 '08 #2

P: 17
thanks nithin,it s careless mistake.


cheers
Nov 5 '08 #3

Post your reply

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