Browse Source

* Added color to Verbosity Box.

* blue = 1  red = 2
master
freesource 24 years ago
parent
commit
50c24778c5
  1. 11
      Yard.pm
  2. 13
      gBootRoot

11
Yard.pm

@ -54,7 +54,7 @@ my $INODE_SIZE = 1024;
my $objcopy = "objcopy";
my($Warnings) = 0;
my $verbosity;
my $text_insert;
my ($text_insert,$red,$blue);
my $logadj;
# This solves an annoying problem with the new Perl-5.6 built in glob,
@ -75,7 +75,7 @@ sub warning {
}
sub verbosity { $verbosity = $_[0]; }
sub text_insert { $text_insert = $_[0]; }
sub text_insert { $text_insert = $_[0]; $red = $_[1]; $blue = $_[2]; }
sub logadj { $logadj = $_[0]; }
# This is because verbosity_box is in start_logging_output
#sub verbosity_window { $verbosity_window = $_[0]; }
@ -1031,7 +1031,12 @@ sub info {
if ($verbosity >= $level) {
if ($text_insert) {
$text_insert->freeze();
$text_insert->insert( undef, undef, undef, $output );
if ($level == 0) {
$text_insert->insert( undef, $blue, undef, $output );
}
elsif ($level == 1) {
$text_insert->insert( undef, $red, undef, $output );
}
$text_insert->thaw();
$logadj->set_value($logadj->upper - $logadj->page_size);
while (Gtk->events_pending) { Gtk->main_iteration; }

13
gBootRoot

@ -2398,9 +2398,12 @@ sub err_custom_perl {
}
}
# This monster needs different behavior than create_text.
sub verbosity_box {
my ($red,$blue);
$verbosity_window = new Gtk::Window "toplevel";
$verbosity_window->signal_connect("destroy", \&destroy_window,
\$verbosity_window);
@ -2436,7 +2439,15 @@ sub verbosity_box {
0, 0 );
$text->grab_focus();
$text->show();
text_insert($text); # yard thing
my $colormap = Gtk::Gdk::Colormap->get_system();
$red->{ 'red' } = 65000;
$blue->{ 'blue' } = 65000;
#$blue->{'red'} = 0;
#$blue->{'green'} = 0;
# Not a fatal problem
error( "Couldn't allocate color\n" )
unless ( defined( $colormap->color_alloc( $blue ) ) );
text_insert($text,$red,$blue); # yard thing
# Add a vertical scrollbar to the GtkText widget
my $vscrollbar = new Gtk::VScrollbar( $text->vadj );

Loading…
Cancel
Save