Gnome2::Canvas surprising behaviour



Hello All,

I discovered something surprising with the "aliased" version of the Gnome2::Canvas.

If you place a Gnome2::Canvas::Text item on an "anti-aliased" canvas and forget to set the 'fill-color' you see nothing. This seems reasonable. If you place a Gnome2::Canvas::Text item on an "aliased" canvas, the text will be displayed even without setting the 'fill-color'. Nice, I suppose, but is this a bug in Gnome2::Canvas?

Below is a sample code snippet:

use strict;
use Gnome2::Canvas;

use Gtk2 '-init';

my $window = Gtk2::Window->new();

my $canvas = Gnome2::Canvas->new();
#my $canvas = Gnome2::Canvas->new_aa();

$window->add($canvas);

$window->signal_connect('destroy'=>\&_closeapp);

$window->set_default_size(450,350);

my $text = 'Hello World!';

Gnome2::Canvas::Item->new($canvas->root, 'Gnome2::Canvas::Text',
             x=>75, y=>75,font=>'Sans 12',
#              fill_color=>'black',
             text=>$text);

$window->show_all();

Gtk2->main();


sub _closeapp
{
   Gtk2->main_quit();
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]