467,114 Members | 1,338 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,114 developers. It's quick & easy.

message box

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
  • viewed: 4143
Share:
2 Replies
nithinpes
Expert 256MB
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
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.

Similar topics

3 posts views Thread by Hugh Welford | last post: by
8 posts views Thread by Brian Keating EI9FXB | last post: by
2 posts views Thread by Microsoft News | last post: by
reply views Thread by ronscottlangham@yahoo.com | last post: by
2 posts views Thread by =?Utf-8?B?QWRl?= | last post: by
2 posts views Thread by bernd | last post: by
2 posts views Thread by forums_mp@hotmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.