From f920a982ac8ecf9040ad155b7f556e1d74572921 Mon Sep 17 00:00:00 2001 From: milkbone57 Date: Fri, 26 Sep 2003 00:49:17 +0000 Subject: [PATCH] Core changes --- lib/Milkbone/HookEntry.pm | 8 +------- milkbone | 35 +++++++++++++++++++++----------- plugins/Tk-Chat/Milkbone/Chat.pm | 5 ++--- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/lib/Milkbone/HookEntry.pm b/lib/Milkbone/HookEntry.pm index cca3298..6a857c6 100644 --- a/lib/Milkbone/HookEntry.pm +++ b/lib/Milkbone/HookEntry.pm @@ -12,12 +12,6 @@ package Milkbone::HookEntry; use strict; use warnings; -require Exporter; - -our @ISA = qw( Exporter ); -our @EXPORT = qw( ); -our @EXPORT_OK = qw( ); - sub new { my $self = {}; @@ -41,4 +35,4 @@ sub call $self->{callback}->(%args, %{$self->{args}}); } -1; \ No newline at end of file +1; diff --git a/milkbone b/milkbone index 5b18340..94bd82e 100755 --- a/milkbone +++ b/milkbone @@ -1,16 +1,21 @@ #!/usr/bin/perl - -# ---------------------------------------------------------------------- -# File: milkbone +# ----------------------------------------------------------------------------- +# milkbone # Desc: This file is the heart of milkbone. It brings up the core and calls # the appropriate guidance script. There's nothing too complicated happening # here; most of it ought to be self-explanatory. -# Quote: "A beginning is the time for ensuring that the balances are correct" -# - Princess Irulan, Dune -# ---------------------------------------------------------------------- +# Quote: "A beginning is the time for taking the most delicate care +# that the balances are correct." +# - Dune +# ----------------------------------------------------------------------------- + +use strict; +use warnings; # Load the core. This prepares @INC for guidance script detection, and # sets default values (e.g. $Milkbone::FatalLog). + +use lib 'lib'; use Milkbone; # Launch the correct guidance script based on the command-line parameters. @@ -36,14 +41,20 @@ else { # something must have gone terribly wrong. Note that the guidance script # doesn't return until the user has closed milkbone. -eval { - require $target; -}; +my $script = slurp($target . ".pl", 1); +$script = <<'END' . $script; +use strict; +use warnings; +END + +eval $script; # Really serious exceptions will get logged into the file pointed to by # $Milkbone::FatalLog. + if($@) { - open(my $file, $Milkbone::FatalLog); - print $file $a; - close($file); + print $@; + open(my $log, ">" . $Milkbone::FatalLog); + print $log "\n" . $@; + close($log); } diff --git a/plugins/Tk-Chat/Milkbone/Chat.pm b/plugins/Tk-Chat/Milkbone/Chat.pm index 44fd46d..7877470 100644 --- a/plugins/Tk-Chat/Milkbone/Chat.pm +++ b/plugins/Tk-Chat/Milkbone/Chat.pm @@ -20,6 +20,7 @@ sub ClassInit sub Populate { my ($self, $args) = @_; + $self->withdraw; $self->SUPER::Populate($args); } @@ -64,11 +65,9 @@ sub init $self->{in} = $self->BrowseEdit(-height => 4)->pack(-fill => 'x', -padx => 3, -pady => 5); - $self->update; $self->geometry("+" . int(($self->screenwidth() / 2) - int($self->width() / 2)) . "+" . int(($self->screenheight() / 2) - int($self->height() / 2)) ); + $self->update; $self->deiconify; - - $self->update(); } 1;