tkinter canvas

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gigs_

    #1

    tkinter canvas

    how to write text on canvas. i know that i need to use canvas.create_t ext, 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!
  • kyosohma@gmail.com

    #2
    Re: tkinter canvas

    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_t ext, 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_t ext(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

    Comment

    • Gigs_

      #3
      Re: tkinter canvas

      kyosohma@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_t ext, 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_t ext(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

      Comment

      • kyosohma@gmail.com

        #4
        Re: tkinter canvas

        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_t ext, 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_t ext(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:



        Find information, resources and relevant links for bembry.org. This domain may be for sale.


        Hope that points you in the right direction.

        Mike

        Comment

        Working...