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 8007373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:48:19+00:00 2026-06-04T17:48:19+00:00

Here is my code: from tkinter import * from tkinter.ttk import * class App:

  • 0

Here is my code:

from tkinter import *
from tkinter.ttk import *

class App:

    def __init__(self, master):
        #Frame.__init__(self, master)

        fuzz = Entry(master, width = 20).grid(column=2,row=2)
        Label (text='Fuzz:').grid(column=1,row=2)

        smoothing = Entry(master, width = 20).grid(column=2,row=3,sticky=N)
        Label (text='Smoothing:').grid(column=1,row=3,sticky=N)

        rendering = Entry(master, width = 20).grid(column=2,row=4,sticky=N)
        Label (text='rendering:').grid(column=1,row=4,sticky=N)


        colors = Listbox(master, selectmode="extended", activestyle="dotbox")

        for item in ["color_1", "color_2", "color_3", "color_4"]:
            colors.insert(END, item)
        colors.grid(row=3,column=3, columnspan =1, padx=10, rowspan=2)

        pics = Listbox(master, selectmode="extended", activestyle="dotbox")

        for item in ["pic_1", "pic_2", "pic_3", "pic_4"]:
            pics.insert(END, item)
        pics.grid(row=3,column=4, columnspan=1, padx=10, rowspan=2)

        addcolor = Button(master, text="add color", )
        addcolor.grid(column=3,row=1, sticky=W+E, padx=10)
        remcolor = Button(master, text="remove color", )
        remcolor.grid(column=3,row=2, sticky=W+E, padx=10)

        addpic = Button(master, text="add pic", )
        addpic.grid(column=4,row=1, sticky=W+E, padx=10)
        rempic = Button(master, text="remove pic",)
        rempic.grid(column=4,row=2, sticky=W+E, padx=10)



root = Tk()

app = App(root)

root.mainloop()

and this is what I want to do: https://i.stack.imgur.com/i66Oy.png

Basically, the listbox spans two rows, and the two cells to the left of the listbox are half the height of the listbox. But is it possible to have the cells as short as the default height?

I have tried:
    changing the rowspan to 1 
    Having the listbox occupy 10 rows (results in odd padding around the cells)
  • 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-04T17:48:21+00:00Added an answer on June 4, 2026 at 5:48 pm

    You have to force the default mechanism which grow each row equally. You have to use grid_rowconfigure to set the “weight” of these rows. The weight is a relative index of how additional space is distributed among rows.

    In your case:

        master.grid_rowconfigure(3, weight=0)
        master.grid_rowconfigure(4, weight=1)
    

    Thus the row 3 (with smoothing) is tell not to occupy additional space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is some code: from Tkinter import * class Main(object): def __init__(self): self.console =
Here is the code: from Tkinter import * def main(): w1 = Tk() w1[height]
here's the code from the APICallsViewController file and a couple of screenshots. my app
Given the code from here : class lazy_init { mutable std::once_flag flag; mutable std::unique_ptr<expensive_data>
Here's the test case... import Tkinter as tk import thread from time import sleep
Here is code from MSDN . I don't understand why the work isn't just
i coppied some code from HERE but i'm getting an error: incorrect syntax near
Trying to use code from here Im trying to incorporate both classes so that
I'm using some code from here to determine when determining when the last finger
I found this code from here: http://www.cssportal.com/form-elements/text-box.htm But the problem is you can still

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.