in reply to Re: Problem with MessageBox Widget in Perl/Tk
in thread Problem with MessageBox Widget in Perl/Tk

thanks zentara..but somehow it is not working.. well I have done something to get around of this problem... But now my problem is that i am not able to get the same error/info/warning icons as i was getting using MessageBox widget.Only simple perl built-in bitmaps, i am able to get. Please help if anybody knows how to get those icons.
use strict; use warnings; use Tk; use Tk::Entry; our $mw = new MainWindow; our $main; my $new_label = $mw -> Label(-text=>"Enter any character", -foreground=>"red", -font => "verdanafont 10 bold") -> pack(-side=>"top"); my $ent=$mw->Entry()->pack(); my $press = $mw -> Button(-text=>"Press Me", -command =>\&PressMe, -font => "verdanafont 10 bold") -> pack(-side=>"left",-padx=>"5", -ipadx=>"5"); MainLoop; sub PressMe { my $val = $ent->get(); if ($val =~ m/[a-zA-Z0-9]/) { #my $response=$mw -> messageBox(-type=>"ok", -message=>"al +phanumeric entered",-icon=>"info",-title=> "info!!"); if (!Exists($main)) { $main = $mw->Toplevel; $main->geometry("250x100"); $main->transient($mw); $main->protocol('WM_DELETE_WINDOW' => sub {$main->destroy( +);}); #$main->Photo('-format'=>'jpeg', -file => "\@C:\\warn.jpg" +); #my $l=$main->Label(-image=>'hi')->pack; my $l = $main->Label(-bitmap=>"info")->pack(-side=>"left") +; my $ll=$main->Label(-text=>"Alpha numeric entered !")->pac +k(); } else { $main->deiconify(); $main->raise(); } } return; }

Replies are listed 'Best First'.
Re^3: Problem with MessageBox Widget in Perl/Tk
by zentara (Cardinal) on Nov 03, 2008 at 13:53 UTC