diff --git a/Milkbone.pm b/Milkbone.pm index fedd3b5..3e7e6d9 100644 --- a/Milkbone.pm +++ b/Milkbone.pm @@ -20,6 +20,8 @@ use Benchmark; our $VERSION = "0.361"; +our $FatalLog = "fatals.txt"; + require Exporter; our @ISA = qw( Exporter ); diff --git a/milkbone b/milkbone index c30f316..5b18340 100755 --- a/milkbone +++ b/milkbone @@ -1,3 +1,49 @@ -#!/bin/sh -cd $HOME/milkbone -perl mos.pl \ No newline at end of file +#!/usr/bin/perl + +# ---------------------------------------------------------------------- +# File: 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 +# ---------------------------------------------------------------------- + +# Load the core. This prepares @INC for guidance script detection, and +# sets default values (e.g. $Milkbone::FatalLog). +use Milkbone; + +# Launch the correct guidance script based on the command-line parameters. +# Note that linking this script to milkbone-x and then invoking that link +# is equivalent to running "milkbone x". If no arguments are supplied, +# "tk" is used as the default guidance script. + +my $target; +if($0 =~ /milkbone-(.*)/) { + $target = $1; + shift @ARGV; +} +elsif(defined($ARGV[0]) and $ARGV[0] !~ /-/) { + $target = $ARGV[0]; + shift @ARGV; +} +else { + $target = "tk"; +} + +# We know the target name now - let's run it. This eval block is the last +# defense against exceptions. If something doesn't get caught here, then +# something must have gone terribly wrong. Note that the guidance script +# doesn't return until the user has closed milkbone. + +eval { + require $target; +}; + +# 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); +} diff --git a/mos.pl b/mos.pl index 8faf494..282ba2a 100755 --- a/mos.pl +++ b/mos.pl @@ -39,15 +39,16 @@ eval { load_plugins; pre_mainloop; - - protocol_signon(-user => 'test', -pass => 'pass'); + + protocol_signon -user => 'test', -pass => 'test'; data("me") = "test"; + #create_logon_prompt; MOSLoop; post_mainloop; } - + # off it goes... main(); }; diff --git a/plugins/Tk-GUI/Tk/BrowseEdit.pm b/plugins/Tk-GUI/Tk/BrowseEdit.pm index 6bcf475..a187e7e 100644 --- a/plugins/Tk-GUI/Tk/BrowseEdit.pm +++ b/plugins/Tk-GUI/Tk/BrowseEdit.pm @@ -39,7 +39,7 @@ sub Populate $self->{panel} = $self->Frame(-borderwidth => 0)->pack(-fill => 'both'); $self->{text} = $self->Text(-background => 'white')->pack(-expand => 1, -fill => 'both'); $self->{''} = $self->{panel}->Button(-text => 'B', -relief => 'flat', - -font => $self->Font(-family => '{adobe arial}', -weight => 'bold', -size => '8'), + -font => $self->Font(-family => '{open look glyph}', -weight => 'bold', -size => '8'), -command => [sub { my ($self) = @_; $self->toggleTag(''); @@ -48,7 +48,7 @@ sub Populate $self->{text}->bind('', [sub { shift->{''}->invoke; }, $self]); $self->{''} = $self->{panel}->Button(-text => 'I', -relief => 'flat', - -font => $self->Font(-family => '{adobe arial}', -slant => 'italic', -size => '8'), + -font => $self->Font(-family => '{open look glyph}', -slant => 'italic', -size => '8'), -command => [sub { my ($self) = @_; $self->toggleTag(''); @@ -57,7 +57,7 @@ $self]); $self->bind('', [sub { shift->{''}->invoke; }, $self]); $self->{''} = $self->{panel}->Button(-text => 'U', -relief => 'flat', - -font => $self->Font(-family => '{adobe arial}', -underline => 1, -size => '8'), + -font => $self->Font(-family => '{open look glyph}', -underline => 1, -size => '8'), -command => [sub { my ($self) = @_; $self->toggleTag(''); @@ -122,8 +122,8 @@ sub toggleTag $cur_tag .= $tag; return unless $cur_tag && $cur_tag ne ""; $self->create_tag($cur_tag) unless $cur_tag eq ""; - $self->insert('insert', chr(255), [$cur_tag, 'elide']) if $cur_tag ne ""; - $self->insert('insert', chr(255), ['elide']) if $cur_tag eq ""; + $self->insert('insert', chr(1), [$cur_tag, 'elide']) if $cur_tag ne ""; + $self->insert('insert', chr(1), ['elide']) if $cur_tag eq ""; $self->{text}->tagAdd($cur_tag, 'insert'); $self->{$button}->configure(-relief => 'sunken'); } @@ -162,7 +162,7 @@ sub toggleTag { self->create_tag($new_tag); return unless $tag; - $self->{text}->tagAdd($tag, $self->{text}->tagRanges('sel')); +h $self->{text}->tagAdd($tag, $self->{text}->tagRanges('sel')); $self->{$tag}->configure(-relief => 'sunken'); } } @@ -173,6 +173,7 @@ sub create_tag my ($self, $tag) = @_; return if $self->{created_tags}->{$tag}; my (%tagparams, %fontparams); + $fontparams{-size} = 10; if($tag =~ //) { $fontparams{-underline} = 1; @@ -190,7 +191,7 @@ sub create_tag $tagparams{-background} = $2; } - my $font = $self->Font(-family => 'times',%fontparams); + my $font = $self->Font(-family => '{open look glyph}',%fontparams); print %fontparams; # XXX: SEGMENTATION FAULT HERE!! $self->tagConfigure($tag, %tagparams, -font => $font);