[Python] how to use grid with textbox? my textsize seems to impact my grid but I don't want it...

Discussão em 'Python' iniciado por Stack, Agosto 3, 2025.

  1. Stack

    Stack Membro Participativo

    I want my screen to have a small notepad in the bottom left.
    My textsize within this textbox seems to impact my grid, but I don't want it to.

    My understanding is that using uniform ="a" fixes such issues, but it seems to persist only in the case of the textbox widget from what I can tell.

    I have some code running in the back while developing that helps me to see the grid.
    A picture of the result below:

    [​IMG]

    My grid and code as below:

    # define a grid

    number_tuple_30 = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30)
    number_tuple_45 = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45)

    wd.columnconfigure(number_tuple_30,weight = 10, uniform = "a")
    wd.rowconfigure(number_tuple_45,weight = 10, uniform = "a")
    wd.columnconfigure(1,weight = 13, uniform = "a")

    # textbox

    text = tk.Text(font=("Courier",15), bg=colour, borderwidth=1, relief="solid")
    text.grid(column=0, row=39, sticky="nesw", columnspan=9, rowspan=7)

    Continue reading...

Compartilhe esta Página