Re: New Canvas



On 4 Aug, 15:06, Torsten Berg <b...@xxxxxxxxxxxxxxxx> wrote:
Hi Mats,

I now tested a few apps where I normally use the canvas widget. They
just look so much better now (MacOS X)! Smooth letters and lines
everywhere. But I had two issues. I sometimes use [$canvas delete all]
to clean the canvas and start from scratch. This will give me the
error "the root item cannot be deleted". While this behaviour is sort
of documented, it breaks canvas compatibility, where you can delete
all items. I understand the new hierachical model with the root item
always being there, so is there a way around this?

We, roger and I, have had some discussions on handling the tag "all"
and I think I just ignore the root item when finding all matching
items to tag "all".


I have a lot of items on the canvas with the tag "bead". When I do
[$canvas delete bead], I get the error

malformed bucket chain in Tcl_DeleteHashEntry
Abort trap

It works in the simple case of

% package require tkpath
0.3.1
% tkp::canvas .c
.c
% pack .c
% .c create oval 0 0 10 10 -tags bead
1
% .c delete bead
%

but fails in my app. I wasn't able to construct a simple case, where
it fails.


There is currently an issue when items are deleted where an item
already deleted implictly via a group is tried to be deleted once
more, which obviously fails (crashes). Instead I think I need to
"flatten out" all items before deleting them so this wont happen (?).

Mats

PS: with "flatten out" I mean to make them direct children of the
root.
.



Relevant Pages

  • Re: Problem displaying images with TkInter
    ... It simply displays a rectangle and an image. ... > from Tkinter import * ... > root = Tk ... The problem lies in the fact that for some reason, the Canvas where you do the ...
    (comp.lang.python)
  • Re: Python-list Digest, Vol 81, Issue 63
    ... root = tkinter.Tk#initialize tkinter and get a top level instance ... root.title("madhuri is a python") ... canvas = tkinter.Canvas#creating the canvas under the root ...
    (comp.lang.python)
  • Re: New Canvas
    ... I now tested a few apps where I normally use the canvas widget. ... I have a lot of items on the canvas with the tag "bead". ... but fails in my app. ...
    (comp.lang.tcl)
  • Re: New Canvas
    ... I now tested a few apps where I normally use the canvas widget. ... I understand the new hierachical model with the root item ... I have a lot of items on the canvas with the tag "bead". ...
    (comp.lang.tcl)
  • Re: AMC: Cant I Root Against Both? (Spoiler Info from 5/22 Episode)
    ... In response to the title of the thread, ... with Bianca gone, you have the right to root against the entire canvas ...
    (rec.arts.tv.soaps.abc)