Python Forum
[Tkinter] How to place scroll bar correctly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to place scroll bar correctly
#1
I have a listbox that is inside of a frame and when I put a scrollbar with the listbox, I want it to be to the right of the listbox but instead is located at the bottom just to the right. How can I place the scrollbar to the side and right of listbox?

lbframe=Frame(rooms, height=50, width=70, border=1)
    lbframe.place(x=40, y=50)

    roomlb = Listbox(lbframe, height=25, width=60, font="courier")
    roomlb.pack()

    scrollbar = Scrollbar(lbframe, orient="vertical")
    scrollbar.config(command=roomlb.yview)
    scrollbar.pack(side="right", fill="y")
    roomlb.config(yscrollcommand=scrollbar.set)

Attached Files

Thumbnail(s)
   
Reply
#2
I figured it out. When packing the Listbox, I added the following parameters:

roomlb = Listbox(lbframe, height=25, width=65, font="courier")
roomlb.pack(side="left", fill="y")
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Treeview scroll selected node to top rfresh737 1 291 Apr-14-2021, 03:27 AM
Last Post: deanhystad
  [Tkinter] canvas widget scroll issue chrisdb 2 391 Apr-07-2021, 05:48 AM
Last Post: chrisdb
  [Tkinter] Help with scroll bars kraco 1 898 Sep-27-2020, 11:20 PM
Last Post: Larz60+
  Label.Place did not work? ATARI_LIVE 15 1,159 Sep-18-2020, 04:22 PM
Last Post: ATARI_LIVE
  How to place global tk text widget in class or on canvas puje 1 577 Jul-04-2020, 09:25 AM
Last Post: deanhystad
  How to use place holders in tkinter sqlite scratchmyhead 1 607 May-12-2020, 06:13 PM
Last Post: Larz60+
  Scroll frame with MouseWheel Nemesis 1 717 Mar-25-2020, 09:29 PM
Last Post: Nemesis
  [Kivy] Why I have to click twice to scroll? Hummingbird 0 1,152 Jan-06-2020, 09:08 PM
Last Post: Hummingbird
  thinker button gui place next to each other jacklee26 9 1,814 Jul-04-2019, 07:48 AM
Last Post: wuf
  [Tkinter] Scroll Bars going backwards goofygoo 2 969 Jun-07-2019, 05:07 PM
Last Post: goofygoo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020