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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:39:19+00:00 2026-05-25T10:39:19+00:00

I’ve embedded 100 rows in 2 columns. Each row is inside a single frame,

  • 0

I’ve embedded 100 rows in 2 columns. Each row is inside a single frame, and all packed inside a text widget. I’m trying to add a scroll bar, but it scrolls only text, while the columns won’t move.

    frame_fields = tk.Text(self.window)
    frame_fields.pack_propagate(0)
    tf = {}
    text_labels = tk.Text(frame_fields)
    text_labels.pack(side='left', expand='yes', fill='both')

    scrollbar = tk.Scrollbar(frame_fields)
    scrollbar.config(command=text_labels.yview)
    scrollbar.pack(side='right', fill='y')
    text_labels.config(yscrollcommand=scrollbar.set)

    for f in range(100):
        tf[f] = tk.Frame(text_labels)
        e_find = tk.Entry(tf[f])
        e_replace = tk.Entry(tf[f])
        e_find.pack(side='left')
        e_replace.pack(side='left')
        tf[f].pack()
    frame_fields.pack()

How should I change this code, so text_labels scroll?

A Solution

The code below creates the scrollable cells:

def create_cells(self):
    """Create cells for exception text"""
    # ----------------------------------------------
    frame_fieldsscroll = tk.Text(self.main, relief='flat')
    text_fields = tk.Text(frame_fieldsscroll, relief='flat')
    frame_fieldsscroll.window_create('insert', window=text_fields)

    tf = {}
    for f in range(31):

        e_find = tk.Entry(text_fields, width=16, relief='flat')
        e_replace = tk.Entry(text_fields, width=16, relief='flat')

        e_find.insert(0, 'find'+str(f))
        e_replace.insert(0, 'replace'+str(f))

        e_find.grid(row=0, column=0)
        e_replace.grid(row=0, column=1)

        text_fields.window_create('insert', window=e_find)
        text_fields.window_create('insert', window=e_replace)

        text_fields.insert('end', '\n')

    scrollbar = tk.Scrollbar(frame_fieldsscroll, width=15)
    scrollbar.config(command=text_fields.yview)
    text_fields.config(yscrollcommand=scrollbar.set)

    frame_fieldsscroll.pack()
    scrollbar.pack(side='right', fill='y')
    text_fields.pack(fill='both')

    text_fields.configure(state='disabled')
    frame_fieldsscroll.configure(state='disabled')
  • 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-25T10:39:20+00:00Added an answer on May 25, 2026 at 10:39 am

    For objects in a window to be scrollable along with the text you must add them with the window_create method of the text widget instead of using pack or grid or place.

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

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I have a reasonable size flat file database of text documents mostly saved in
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

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.