Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter and Scrollbar

Reply
Thread Tools

Tkinter and Scrollbar

 
 
codecraig
Guest
Posts: n/a
 
      04-19-2005
Hi,
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,
orient=HORIZONTAL)
self._scrollbarX.pack(side=BOTTOM, fill=X)

self._list = Listbox(self.myContainer)
self._list.pack()

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)


Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tkinter scrollbar and checkbox goldtech Python 2 04-25-2008 03:21 PM
tkinter modifying multiple widgets with one scrollbar spohle Python 1 06-24-2006 03:30 PM
Tkinter Scrollbar not working Dustan Python 8 01-03-2006 11:12 PM
Tkinter: scrollbar in grid-managed frame anx@io.us Python 1 11-16-2005 09:47 PM
ScrollBar? Does it exist just WEB ScrollBar Control? Alex ASP .Net Web Controls 1 04-04-2004 12:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57