mikasue has asked for the wisdom of the Perl Monks concerning the following question:
I have a TK program and need to share my MainWindow across packages. Please enlighten me on how I can do this.
# my main program
Now I have another file that I want to be able to use $MW in to be the parent of my dialog box.use strict; use warnings; use Tk; our $MW = MainWindow->new(%{$BPP::BPPDEFAULTS::MYDEFAULTS{MAINWINDOW}} +); $MW->geometry('800x700+0+0'); ...
use Tk::Dialogbox; package BPP::ABOUT; sub AboutBPP { my $about_dialog = $MW->DialogBox( -title=>'About BPP', -background=>'#ffffcc', -buttons=>["Ok"],); my $pic = $about_dialog->Photo(-file=>'money.gif'); $about_dialog->add('Label', -image=>$pic,-background=>'#ffffcc' ) +->grid(-row=>0, -column=>0,-sticky=>'w'); $about_dialog->Show; }#end AboutBPP 1
Update
Here is the error message i'm getting:
THANKS!Tk::Error: Can't call method "DialogBox" on an undefined value at BPP/ +ABOUT.pm l ine 14. (menu invoke)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sharing Across Packages
by Velaki (Chaplain) on Sep 29, 2006 at 11:55 UTC | |
by polettix (Vicar) on Sep 29, 2006 at 12:46 UTC | |
|
Re: Sharing Across Packages
by polettix (Vicar) on Sep 29, 2006 at 12:38 UTC | |
by Anonymous Monk on Sep 29, 2006 at 13:54 UTC | |
by polettix (Vicar) on Sep 29, 2006 at 15:59 UTC | |
by mikasue (Friar) on Sep 29, 2006 at 22:37 UTC | |
by polettix (Vicar) on Sep 30, 2006 at 00:41 UTC | |
|
Re: Sharing Across Packages
by Anonymous Monk on Sep 29, 2006 at 11:53 UTC |