470,613 Members | 2,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,613 developers. It's quick & easy.

Tkinter and Scrollbar

I am trying to use a Scrollbar for a Listbox. I want a scrollbar
which which has the vertical and horizontal scroll bars. Here is how i
am doing it now, is the only way or "best" way to do it?
# vertical scroll bar for list
self._scrollbarY = Scrollbar(self.myContainer)
self._scrollbarY.pack(side=RIGHT, fill=Y)

# horizontal scroll bar for list
self._scrollbarX = Scrollbar(self.myContainer,
self._scrollbarX.pack(side=BOTTOM, fill=X)

self._list = Listbox(self.myContainer)

for i in range(100):
self._list.insert(END, "a"*i)

self._list.config(yscrollcommand=self._scrollbarY. set)
self._list.config(xscrollcommand=self._scrollbarX. set)
self._scrollbarY.config(command = self._list.yview)
self._scrollbarX.config(command = self._list.xview)

Jul 19 '05 #1
0 1013

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Thomas Buschhardt | last post: by
4 posts views Thread by Patrick L. Nolan | last post: by
1 post views Thread by syed_saqib_ali | last post: by
reply views Thread by syed_saqib_ali | last post: by
8 posts views Thread by Dustan | last post: by
1 post views Thread by C D Wood | last post: by
6 posts views Thread by Adam | last post: by
2 posts views Thread by goldtech | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.