how to write text on canvas. i know that i need to use canvas.create_text, but
how to write text than when i create_text?
or how to access object ID in canvas and change some options?
thanks in advance! 3 5668
On Apr 18, 3:43 pm, Gigs_ <g...@hi.t-com.hrwrote:
how to write text on canvas. i know that i need to use canvas.create_text, but
how to write text than when i create_text?
or how to access object ID in canvas and change some options?
thanks in advance!
All you need to do is canvas.create_text(x, y, text='Hello World')
where x and y are coordinates on the canvas. You can also add fg and/
or bg to set foreground and background colors, respectively.
Mike ky******@gmail.com wrote:
On Apr 18, 3:43 pm, Gigs_ <g...@hi.t-com.hrwrote:
>how to write text on canvas. i know that i need to use canvas.create_text, but how to write text than when i create_text? or how to access object ID in canvas and change some options?
thanks in advance!
All you need to do is canvas.create_text(x, y, text='Hello World')
where x and y are coordinates on the canvas. You can also add fg and/
or bg to set foreground and background colors, respectively.
Mike
but is there any option to bind event?
when i create text i want to write in text box on canvas so i think that i need
to bind event
On Apr 19, 7:24 am, Gigs_ <g...@hi.t-com.hrwrote:
kyoso...@gmail.com wrote:
On Apr 18, 3:43 pm, Gigs_ <g...@hi.t-com.hrwrote:
how to write text on canvas. i know that i need to use canvas.create_text, but
how to write text than when i create_text?
or how to access object ID in canvas and change some options?
thanks in advance!
All you need to do is canvas.create_text(x, y, text='Hello World')
where x and y are coordinates on the canvas. You can also add fg and/
or bg to set foreground and background colors, respectively.
Mike
but is there any option to bind event?
when i create text i want to write in text box on canvas so i think that i need
to bind event
I'm not sure what you mean. Do you want to type your text into a
textbox and as you type, you want it displayed on the canvas itself as
well? If that is the case, then yes, you'll need to bind an event. If
you just want to type text in a textbox that is on a canvas, the
textbox widget takes care of everything and binding an event is
unnecessary.
Here is some info on events: http://effbot.org/tkinterbook/tkinte...d-bindings.htm http://www.builderau.com.au/program/...14t-320000000c http://www.bembry.org/technology/pyt.../tkinter_3.php
Hope that points you in the right direction.
Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mksql |
last post by:
New to Tkinter. Initially, I had some code that was executing button commands at
creation, rather than waiting for user action. Some research here gave me a
solution, but I am not sure why the...
|
by: Elaine Jackson |
last post by:
Newbie. Playing with the 'turtle' module and wondering if there's a way to save
the graphics you make with it. The documentation itself has nothing to say about
this, nor (as far as I can tell)...
|
by: syed_saqib_ali |
last post by:
Please take a look at and run the code snippet shown below.
It creates a canvas with vertical & Horizontal scroll-bars.
If you shrink the window to smaller than the area of the canvas, the...
|
by: syed_saqib_ali |
last post by:
Below is a simple code snippet showing a Tkinter Window bearing a
canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine.
When you shrink/resize the window the scrollbars adjust...
|
by: Tuvas |
last post by:
I'm trying to display a picture on a Tkinter Canvas. It seems to work
fine the first time that it is displayed. However, subsequent times
running shows an error like this:
TCLerror: Wrong #...
|
by: Dean Allen Provins |
last post by:
I need to determine the size of a canvas while the process is running.
Does anyone know of a technique that will let me do that?
Thanks,
Dean
|
by: Davy |
last post by:
Hi all,
I have written a simple Tkinter program, that is draw a rectangle in a
canvas, when I press Up key, the rectangle move up. But the program
seems work not properly? My environment is...
|
by: skanemupp |
last post by:
mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif')
w.create_image(10, 10, image = mapq, anchor = NW)
after doing this is there any possibility of getting the
characteristics of...
|
by: Peter Pearson |
last post by:
Tkinter makes it very easy to drag jpeg images around on a
canvas, but I would like to have a "target" change color when
the cursor dragging an image passes over it. I seem to be
blocked by the...
|
by: joshdw4 |
last post by:
I hate to do this, but I've thoroughly exhausted google search. Yes,
it's that pesky root window and I have tried withdraw to no avail. I'm
assuming this is because of the methods I'm using. I...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |