Using the tkinter module, suppose I create a grid with 50 button widgets and each of those widgets have different text. I need to be able to specify some way of typing in a row and column and I can get that widget's text at that location. So 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.
Thanks in advance
Best Answer
There's no need to create your own function or keep a list/dictionary, tkinter already has a built-in
grid_slaves()
method. It can be used asframe.grid_slaves(row=some_row, column=some_column)
Here's an example with a grid of buttons showing how
grid_slaves()
retrieves the widget, as well as displaying the text.