Canvas items into widgets?

B

Bob Greschke

I have a "tooltip" class that is used like

Lab = Label(Sub, text = "Temp:")
Lab.pack()
Tooltip(Lab, "The temperature of the reactor core")

When the mouse pointer is placed over the "Temp:" label the associated
message pops up in a small window near the pointer.

I want to use the same thing with a canvas item, but the "create_x" calls
return an ID number not a widget 'handle' like Label() does. Is there a way
to turn these IDs into widgets? I mean the ovals and rectangles are,
technically, widgets already, aren't they? I don't think the tag_bind stuff
will quite work (but I don't fully grasp the concept, except in cases where
you want to do something like drag the items around on the canvas) since
each item will have a different message, like, for example, each point on a
graph will have a tooltip that reports what the temperature of that point
was.

The concept:

Rec = can.create_rectangle(<small red rectangle>)
Wig = (Then a miracle occurs)
Tooltip(Wig, "1500C - She's gonna blow!!")


Thanks!

Bob :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top