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

  • SEARCH
  • Home
  • 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 6904849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:06:43+00:00 2026-05-27T08:06:43+00:00

Using the tkinter module, suppose I create a grid with 50 button widgets and

  • 0

Using the tkinter module, suppose I create a grid with 50 button widgets and each of those widgets has different text. I need to be able to specify some way of typing in a row and column so I can get that widget’s text at that location.

For example, if I need the widget’s text at the third row in the second column of the grid. I’ve searched the docs but that tells me how to get info about widgets, when I need info about the grid.

  • 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-05-27T08:06:44+00:00Added an answer on May 27, 2026 at 8:06 am

    You got a previous answer relative to a method to save button objects in a dictionary in order to recover them using their (column, row) position in a grid.

    So if self.mybuttons is your dictionary of lists of buttons as described in previous answer, then you can get the text at position row, col as this:

    abutton = self.mybuttons[arow][acolumn]
    text_at_row_col = abutton["text"]
    

    On the other hand, if what you need is to get the text from the button callback:

    button.bind("<Button-1>", self.callback)
    

    then you can get the button text from the event, you do not need to know its row/col position, only to press it:

    def callback(self, event):
        mybutton = event.widget
        text_at_row_col = mybutton["text"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a GUI in Python using the Tkinter module, and part
Using C#, I need a class called User that has a username, password, active
I have a python based tkinter script which executes some commands using subprocess module.
I'm using Tkinter in Python, and trying to create code to run when a
I know how to create a Listbox using Tkinter but this only allows me
I'm using the line below to paste text in a Tkinter Text widget. However,
I'm trying create an executable for Windows for a GUI application in tkinter using
I'm new to Python and I'm trying to create a simple GUI using Tkinter.
I'm using Python's Tkinter to create a GUI for a project i'm working on.
After learning python (cpython) and using this page to search for tkinter widgets' options,

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.