Re: Scribble Example
- From: Kevin Ryde <user42 zip com au>
- To: Mario Kemper <mario kemper googlemail com>
- Cc: "gtk-perl-list gnome org" <gtk-perl-list gnome org>
- Subject: Re: Scribble Example
- Date: Tue, 05 Aug 2008 10:06:45 +1000
zentara <zentara1 sbcglobal net> writes:
I chopped down your model to the point where it would draw a simple
rectangle, without the mouse drag. Then I added a line at a time back in,
until it stopped working.
The culprit is:
$gc->set_function ('xor');
Yes and no, I suspect there's no pixel values set into the gc. The RGB
parts of a GdkColor have no effect at the gc->set_foreground level ...
Mario Kemper <mario kemper googlemail com> writes:
my $redcolor = Gtk2::Gdk::Color->new (255, 0, 0);
my $blackcolor = Gtk2::Gdk::Color->new (0, 0, 0);
my $gc = Gtk2::Gdk::GC->new ($root, undef);
$gc->set_foreground($redcolor);
$gc->set_background($blackcolor);
$gc->set_subwindow ('include-inferiors');
$gc->set_function ('xor');
Incidentally it might be worth doing a grab_server to stop other clients
making a mess of the drawing at the same time ...
An alternative would be some little Nx1 windows to be the sides of the
rectangle and move/resize them. The disadvantage is it probably makes
the other clients do lots of redrawing - unless "save under" is enabled
in the server, which rather disappointingly it seems is not the default
in X.org 7 for instance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]