in reply to Tk::Canvas and using stipples

I asked this awhile back, when trying to do Drawing venn diagrams Gtk2 or Zinc does it far better, because they support transparecy levels in the colors. As far as the Tk Canvas goes
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); # first create a canvas widget my $canvas = $mw->Canvas(width => 300, height => 200)->pack(); my $one = $canvas->createOval(55, 20, 200, 190, -fill => 'blue', -outline=>'blue', -tags => ['blue'], -stipple => 'gray75', ); my $two = $canvas->createOval(105, 20, 250, 190, -fill => 'red', -outline=>'red', -tags => ['red'], -stipple => 'gray12', #-stipple => 'transparent', ); my $ebutton = $mw->Button(-text => 'Exit', -command => 'Tk::exit')->pack(); $canvas->Tk::bind("<Motion>", [ \&print_xy, Ev('x'), Ev('y') ]); MainLoop(); sub print_xy { my ($canv, $x, $y) = @_; # print "(x,y) = ", $canv->canvasx($x), ", ", $canv->canvasy($y), "\n +"; #my $x1 = $x+1; #my $y1 = $y+1; my (@current) = $canvas->find('overlapping', $x, $y, $x, $y); foreach my $id(@current){ print $canvas->gettags($id),' '; } print "\n"; } __END__

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Tk::Canvas and using stipples
by BrowserUk (Patriarch) on Feb 03, 2006 at 20:00 UTC

    This looks amazingly like my test code, except I have three circles red, green, and blue overlapping in the usual way. However, your code produces exactly the same non-effect as mine.

    Just in case you are seeing something different to me, I have uploaded a pixel grab png of your demo above as my homenode pic. Does it look different on your machine?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Yeah, there is something wrong with your Tk, maybe you are using windows? Here is what I see screenshot

      I'm not really a human, but I play one on earth. flash japh

        Hmm. Overnight I completely wiped 5.8 from my machine and installed afresh. I just re-ran your sample and got exactly the same results. Seems like there is either a bug or a limitation in Tk 804.027 on Win32 :(

        I wonder if it is a known/documented limitation or just something that hasn't been reported. Where is the best place to ask?

        Anyway, many thanks for the sample* and confirmation. At least I can stop pursuing a lost cause now :)

        *And the latest one.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.