mirror of
https://github.com/fspc/gbootroot.git
synced 2025-02-23 00:53:23 -05:00
* Added color to Verbosity Box.
* blue = 1 red = 2
This commit is contained in:
parent
51854a7794
commit
50c24778c5
11
Yard.pm
11
Yard.pm
@ -54,7 +54,7 @@ my $INODE_SIZE = 1024;
|
|||||||
my $objcopy = "objcopy";
|
my $objcopy = "objcopy";
|
||||||
my($Warnings) = 0;
|
my($Warnings) = 0;
|
||||||
my $verbosity;
|
my $verbosity;
|
||||||
my $text_insert;
|
my ($text_insert,$red,$blue);
|
||||||
my $logadj;
|
my $logadj;
|
||||||
|
|
||||||
# This solves an annoying problem with the new Perl-5.6 built in glob,
|
# 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 verbosity { $verbosity = $_[0]; }
|
||||||
sub text_insert { $text_insert = $_[0]; }
|
sub text_insert { $text_insert = $_[0]; $red = $_[1]; $blue = $_[2]; }
|
||||||
sub logadj { $logadj = $_[0]; }
|
sub logadj { $logadj = $_[0]; }
|
||||||
# This is because verbosity_box is in start_logging_output
|
# This is because verbosity_box is in start_logging_output
|
||||||
#sub verbosity_window { $verbosity_window = $_[0]; }
|
#sub verbosity_window { $verbosity_window = $_[0]; }
|
||||||
@ -1031,7 +1031,12 @@ sub info {
|
|||||||
if ($verbosity >= $level) {
|
if ($verbosity >= $level) {
|
||||||
if ($text_insert) {
|
if ($text_insert) {
|
||||||
$text_insert->freeze();
|
$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();
|
$text_insert->thaw();
|
||||||
$logadj->set_value($logadj->upper - $logadj->page_size);
|
$logadj->set_value($logadj->upper - $logadj->page_size);
|
||||||
while (Gtk->events_pending) { Gtk->main_iteration; }
|
while (Gtk->events_pending) { Gtk->main_iteration; }
|
||||||
|
13
gBootRoot
13
gBootRoot
@ -2398,9 +2398,12 @@ sub err_custom_perl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# This monster needs different behavior than create_text.
|
# This monster needs different behavior than create_text.
|
||||||
sub verbosity_box {
|
sub verbosity_box {
|
||||||
|
|
||||||
|
my ($red,$blue);
|
||||||
|
|
||||||
$verbosity_window = new Gtk::Window "toplevel";
|
$verbosity_window = new Gtk::Window "toplevel";
|
||||||
$verbosity_window->signal_connect("destroy", \&destroy_window,
|
$verbosity_window->signal_connect("destroy", \&destroy_window,
|
||||||
\$verbosity_window);
|
\$verbosity_window);
|
||||||
@ -2436,7 +2439,15 @@ sub verbosity_box {
|
|||||||
0, 0 );
|
0, 0 );
|
||||||
$text->grab_focus();
|
$text->grab_focus();
|
||||||
$text->show();
|
$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
|
# Add a vertical scrollbar to the GtkText widget
|
||||||
my $vscrollbar = new Gtk::VScrollbar( $text->vadj );
|
my $vscrollbar = new Gtk::VScrollbar( $text->vadj );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user