Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9156549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:48:03+00:00 2026-06-17T12:48:03+00:00

I have a Tkinter canvas populated with text and canvas windows, or widgets, created

  • 0

I have a Tkinter canvas populated with text and canvas windows, or widgets, created using the create_text and create_window methods. The widgets I place on the canvas are text widgets, and I want to insert text into them after they are created and placed. I can’t figure out how to do this, if it’s even possible. I realise you can edit them after creation using canvas.itemconfig(tagOrId, cnf), but text can’t be inserted that way. Is there a solution to this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:48:05+00:00Added an answer on June 17, 2026 at 12:48 pm

    First, lets get the terminology straight: you aren’t creating widgets, you’re creating canvas items. There’s a big difference between a Tkinter text widget and a canvas text item.

    There are two ways to set the text of a canvas text item. You can use itemconfigure to set the text attribute, and you can use the insert method of the canvas to insert text in the text item.

    In the following example, the text item will show the string “this is the new text”:

    import Tkinter as tk
    
    class Example(tk.Frame):
        def __init__(self, *args, **kwargs):
            tk.Frame.__init__(self, *args, **kwargs)
            canvas = tk.Canvas(self, width=800, height=500)
            canvas.pack(side="top", fill="both", expand=True)
            canvas_id = canvas.create_text(10, 10, anchor="nw")
    
            canvas.itemconfig(canvas_id, text="this is the text")
            canvas.insert(canvas_id, 12, "new ")
    
    if __name__ == "__main__":
        root = tk.Tk()
        Example(root).pack(side="top", fill="both", expand=True)
        root.mainloop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Python Tkinter and I want to place a variable number of text
I want to change the canvas size after I have added some widgets to
I have a list of tkinter widgets that I want to change dynamically. How
I have some Tkinter canvas and some picture of lines and text on it.
I'm using Python and tkinter . I have a Canvas widget that will display
I'm writing Conway's game of life using Tkinter, and I want to have a
I have a Tkinter Canvas widget (Python 2.7, not 3), and on this Canvas
I want to dynamically create Tkinter windows on my screen. I understand that I
I have this code here that creates a Tkinter Canvas widget, then embeds an
I'm trying to have it so that multiple objects on a canvas in Tkinter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.