in reply to Re^3: Masking Tk Canvas
in thread Masking Tk Canvas

Yeah. Basicaly I need the internal movement. I just want to create a layer in the same canvas with rectangular shape which contains much more than the rectangle and then move the contents in the second layer. 1st the contents itself that has been masked and second- the whole layer - which consists of this rectangle masking. I agree about Zinc, I've seen the zooming glass. The idea is the following, I am trying to make a single canvas in which I want to have sort of a background pattern and then a second (may be canvas) layer that has image items which must be scrolled in pages (like a list). I don't think this can be acheived trough the ordinary canvas (Tk::Canvas) using only one canvas widget, that's why I am thinking that the best is to create a second widget and use ->place geometry manager to possition it relatively from the 0,0 of the background canvas... The problem that comes with this is that there is no way to make the background of the second canvas transparent so the user can see trought the top widget wherever there is no content - the bottom widget. I am not showing this in the flash sample... Anyway... Thanks a lot for the reply. I've been just wandering whether something like canvas in canvas can be acheived using the standard Tk canvas. :) Thanks again!!!

Replies are listed 'Best First'.
Re^5: Masking Tk Canvas
by zentara (Cardinal) on Sep 19, 2005 at 10:39 UTC
    I understand better now, what you want to do. In the Tk widgets demo, there is an example called "tiles and transparent images". That should give you a start.

    You are probably really pushing the limits of what the ordinary Canvas can do, if you start moving things around, and expect the transparency to update itself without distortions. I would switch to Zinc. It has better 'group' support and many other improvements over Canvas, that would make your job easier.

    And forget the second canvas idea. You won't be able to see thru it, without faking it, by taking what is currently below it, and mirroring it above. You can check out Zinc - Star Wars Scrolling Text for an idea of what Zinc can do, you can add images to the background(or scroll) if you wanted, or make everything draggable.


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