tkinter-canvas

How to remove icursor from Tkinter canvas text item?

泪湿孤枕 提交于 2021-01-05 09:26:05
问题 I'm following along with Effbot's Tkinter page here: http://effbot.org/zone/editing-canvas-text-items.htm The trouble I'm having is that after inserting the icursor, I can't seem to get it to go away! How do I stop editing altogether? As for examples, the one from the linked page will work: # File: canvas-editing-example-1.py # # editing canvas items # # fredrik lundh, december 1998 # # fredrik@pythonware.com # http://www.pythonware.com # from tkinter import * #Change to Tkinter to use python

tkinter - Why is there such a thing like bbox?

為{幸葍}努か 提交于 2020-12-31 11:49:32
问题 Now that I'm working more with tkinter Canvas I was wondering about the use of bbox. For me I'm using bbox to get the coords of an element but the Canvas already have a method to return the coords of an item. So why did they invent something like bbox? Comparing the official tcl description here: bbox pathName bbox tagOrId ?tagOrId tagOrId ...? Returns a list with four elements giving an approximate bounding box for all the items named by the tagOrId arguments. The list has the form ``x1 y1

tkinter winfo_screenwidth() when used with dual monitors

痞子三分冷 提交于 2020-12-25 17:43:08
问题 With tkinter canvas, to calculate the size of the graphics I display, I normally use the function winfo_screenwidth() , and size my objects accordingly. But when used on a system with two monitors, winfo_screenwidth() returns the combined width of both monitors -- which messes up my graphics. How can I find out the screen width in pixels of each monitor, separately? I have had this problem with several versions of Python 3.x and several versions of tkinter (all 8.5 or above) on a variety of

tkinter winfo_screenwidth() when used with dual monitors

老子叫甜甜 提交于 2020-12-25 17:41:46
问题 With tkinter canvas, to calculate the size of the graphics I display, I normally use the function winfo_screenwidth() , and size my objects accordingly. But when used on a system with two monitors, winfo_screenwidth() returns the combined width of both monitors -- which messes up my graphics. How can I find out the screen width in pixels of each monitor, separately? I have had this problem with several versions of Python 3.x and several versions of tkinter (all 8.5 or above) on a variety of