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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:12:27+00:00 2026-06-08T15:12:27+00:00

EDIT: Sorry, I should’ve searched more before I asked, because I’ve found a solution

  • 0

EDIT: Sorry, I should’ve searched more before I asked, because I’ve found a solution to my problem now. Link: Adding a scrollbar to a group of widgets in Tkinter

I’m trying to add a canvas to a Tkinter GUI, where entry widgets with text from a file is added to a grid. The amount of text in the file tends to be a big, so I need to add a scrollbar.

The entry widgets is added to the canvas the way they’re supposed to, and I’ve independently tested the scrollbar, and it works fine – except when the entry widgets are added. When I do that, the scrollbar disappears.

Here is the code for the canvas and scrollbar:

    groupfr = Frame(self.labelll, width = 200, height = 1000)
    groupfr.pack_propagate(0)
    groupfr.pack(fill='both', side='left')

    canvasgroup = Pmw.Group(groupfr, tag_text= 'canvasgroup')   
    canvasgroup.pack(fill = 'both', expand = 1, padx = 1, pady = 1)

    self.canvas = Tkinter.Canvas(canvasgroup.interior(), width = 200,
                                 height = 1000, bg = 'white')

    self.canvas.config(scrollregion=(0,0,20,1000))
    self.sbar = Tkinter.Scrollbar(self.canvas)
    self.sbar.config(command=self.canvas.yview)

    self.canvas.config(yscrollcommand=self.sbar.set)

    self.sbar.pack(side='right', fill='y')

    self.canvas.pack_propagate(0)
    self.canvas.pack(side = 'left', fill = 'y', expand = 'no')

My apologies for the terrible code. This, however, is where the real problems begin:

for items in linematch:
    items = items.split('=')
    list_of_lists.append(items)

    columncount = 0
    rowcount = 0

    for items in list_of_lists:
        rowcount = rowcount + 1
        columncount = 0

        for idx, (words) in enumerate(zip(items)):
            self.canvas.pack_propagate(0)
            colcnt = colcnt + 1
            idx = Tkinter.Entry(self.canvas)
            idx.grid(row=rowcount, column=columncount)
            idx.insert(0, words)

The code takes the file input and makes each line into a list of two items, which is itself appended to another list. This list of lists is used put into entry widgets like this, with each word (and translation) in their own entry widget:

word translation
word translation

etc. (Don’t know how important this info is.)

Does anyone get why the scrollbar disappears when the entry widgets is added?

Thanks

  • 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-08T15:12:33+00:00Added an answer on June 8, 2026 at 3:12 pm

    You must use the canvas create_window method to add widgets to the canvas. If you use pack or grid they won’t be part of the canvas and thus won’t be affected by the scrollbars.

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

Sidebar

Related Questions

EDIT: Sorry, I should have been more clear. My webpage needs to be XHTML
EDIT Sorry I forgot the most important part here. Each key can have more
Sorry for bumpy topic name (feel free to edit if you find more fitting
Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls
<p><span><a href=link></a></span></p> How would I unwrap everything leaving just <a href=link></a> ? -edit- Sorry,
Ok, with the same program previously I've now hit a problem I should have
IMPORTANT EDIT: Sorry everyone, i made a big mistake in the structure. char *name;
[edit]: I'm terribly sorry for my timing on asking this question. I've just discovered
EDIT: It does work (sorry). Something in this script is causing it to stop
Edit: When I say SQL Server, I'm really talking about the Management Studio. Sorry

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.