473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Setting the height of a scrollbar in Tkinter

HI,
Iam creating a python application using Tkinter.
Ia trying to attach a scrollbar to a listbox.
Please tell me how can i set the height of the scrollbar to that of
the listbox. Beacuse in the docs i found the fill=X
and fill=Y options, but this is not i want.
I want to limit the height of scrollbar to match the height of listbox.
Expand|Select|Wrap|Line Numbers
  1.     listbox=Listbox(parentwnd,width=100,height=40)
  2.     listbox.place(x=20,y=20)
  3.     scroll1=Scrollbar(orient=VERTICAL,width=200)
  4.     scroll2=Scrollbar()
  5.     scroll1.place(x=610,y=20)
  6.     listbox.config(yscrollcommand=scroll1.set)
  7.     scroll1.config(command=listbox.yview)
  8.     scroll1.set(20,200)
  9.  
Thanx
Apr 26 '08 #1
2 21569
raubana
56
Um, to tell you the truth: I don't know anything about Tkinter.

I do know that if you go to help() (after Tkintet is imported), you can look up
a function you need help with. Try something like this:

(1) call "help(NAME_OF_IMPORT)". A large amout of stuff may pop up. Just go to the top of it all and look for any other classes that may be in Tkinter.

(2) Repeat untill you find your class. When you repeat, write it like this:
ex: 'pygame.display'

(3) When you find the class your looking for, type in the whole 'link'
in help and it should tell you all of that classes commands.

That should be helpfull! Good luck.
Apr 30 '08 #2
mujtablue
1 Bit
Hello if you are using a vertical scrollbar:
Expand|Select|Wrap|Line Numbers
  1. scroll1=Scrollbar(orient='vertical')
  2. scroll1.place(x=1,y=1,height=100)
and if you are using a horizontal scroll bar:
Expand|Select|Wrap|Line Numbers
  1. scroll2=Scrollbar(orient='horizontal')
  2. scroll2.place(x=1,y=200,width=100)
so basically Scrollbar(orient=VERTICAL/HORIZONTAL).place(x=x,y=y,height/width=amount)


thats for place if you are using pack its like
Expand|Select|Wrap|Line Numbers
  1. scrollbar3=Scrollbar(master=None,orient=VERTICAL/HORIZONTAL).pack(ipadx/ipady=amount)
Aug 7 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Gordon Airport | last post by:
None of the online references that I'm using or can find tell you if this can be done. It's standard practice in GUI's to have the handle of a scrollbar sized to be the proportion of total ammount...
14
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I...
1
by: alvinpoon | last post by:
Hello, I have a problem setting the scrollbar position of a div region on a webpage which is posted at http://www.geocities.com/virtuosity999/Logon.htm If the page is loaded with Netscape,...
2
by: Mikkel Faarup | last post by:
Hi All I am are experiencing difficulties setting Windows.Form heights above around 1000px on screens with the resolution set to 1024x768. The form is simply cut off and a scrollbar is set. The...
0
by: Anupam Mukherjee | last post by:
Hi, I have a Vertical ScrollBar inside a form. How do I get or set the height of the paddle inside the ScrollBar control? Note that it is a separate ScrollBar control nad cannot lnow by itself...
5
by: Dennis | last post by:
I have a class that inherits from DataGrid. I can set the rowheights in a DataGrid by tappig into the "get_Datagridrows" method. However, this does not work for classes that inherit from...
2
by: anx | last post by:
I've got a grid-managed frame, containing a column of Labels, and a corresponding column of Entry widgets. I'd like to be able to display dozens, or even hundreds of rows, and use a vertical...
8
by: Dustan | last post by:
I'm trying to get a scrollbar bound with a Frame, and I keep on getting a scrollbar, but it doesn't actually scroll. Some help, please?
2
by: goldtech | last post by:
Hi, I'm stumped on how to have a scrollbar with a long list of checkboxes. Given code like: from Tkinter import * root = Tk() states = for i in range(150): var = IntVar()
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.