944,098 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 5712
  • Python RSS
Sep 20th, 2006
0

Pygtk scrollbar

Expand Post »
Hi,
i am using Pygtk to make GUI . I have a frame in which i have added a VBox..
I want to add scrollbar in that VBox.. but couldn't figure out how to add it.
Python Syntax (Toggle Plain Text)
  1.  
  2. vscrollbar = gtk.VSscrollbar(adjustment=None)
  3. AttributeError: 'module' object has no attribute 'VSscrollbar'
it's giving me this error

what should i do?

thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
JyotiC is offline Offline
26 posts
since Sep 2006
Oct 1st, 2006
0

Re: Pygtk scrollbar

You have spelt VScrollbar incorrectly, only 1 s!

Regards
Reputation Points: 10
Solved Threads: 1
Newbie Poster
paulmal is offline Offline
2 posts
since Sep 2006
Oct 3rd, 2006
0

Re: Pygtk scrollbar

hi,
thank you, the error is resolved.
but i cant seem to put it in use.

i have a long list, which require more than a page to cover up.
i want the scrollbar, so that i can see the whole list.
how do i make it attach to the list.

this is the snippet of the code
Python Syntax (Toggle Plain Text)
  1. def __init__(self):
  2. self.window=gtk.Window(gtk.WINDOW_TOPLEVEL)
  3. self.window.maximize()
  4. self.window.connect("delete_event",self.delete_event)
  5. self.window.connect("destroy",self.destroy)
  6.  
  7. hbox=gtk.HBox(False,1)
  8. vbox=gtk.VBox(False,1)
  9. hbox.pack_start(vbox,False,False,0)
  10. vbox.show()
  11. for i in xrange(100):
  12. label=gtk.Label(str(i))
  13. vbox.pack_start(label,False,False,0)
  14. label.show()
  15.  
  16.  
  17. vbox=gtk.VBox(False,1)
  18. hbox.pack_start(vbox,False,False,0)
  19. vbox.show()
  20. vscrollbar = gtk.VScrollbar()
  21. vbox.pack_start(vscrollbar,True,True,0)
  22. vscrollbar.show()
  23.  
  24. hbox.show()
  25. self.window.add(hbox)
  26. self.window.show()
Reputation Points: 10
Solved Threads: 1
Light Poster
JyotiC is offline Offline
26 posts
since Sep 2006
Oct 3rd, 2006
0

Re: Pygtk scrollbar

Hi

It is actually easier to use ScrolledWindow. Here is a link to the pygtk tutorial which gives a good example:

http://www.pygtk.org/pygtktutorial/s...edWindows.html

Regards, Paul
Reputation Points: 10
Solved Threads: 1
Newbie Poster
paulmal is offline Offline
2 posts
since Sep 2006
Oct 4th, 2006
0

Re: Pygtk scrollbar

thank you
Reputation Points: 10
Solved Threads: 1
Light Poster
JyotiC is offline Offline
26 posts
since Sep 2006
Oct 4th, 2006
0

Re: Pygtk scrollbar

I have used pygtk one little and have found these good resources:
Quote ...
Recommended reading for Python+GTK users
PyGTK 2.0 Tutorial by John Finlay
download from: http://www.pygtk.org/dist/pygtk2-tut.pdf

also:
PyGTK FAQ Index
at: http://www.async.com.br/faq/pygtk/index.py?req=index
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005
Oct 5th, 2006
0

Re: Pygtk scrollbar

thank you,
these links r really helpfull
Reputation Points: 10
Solved Threads: 1
Light Poster
JyotiC is offline Offline
26 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Is Python really that buggy?
Next Thread in Python Forum Timeline: Sort a List of Tuples by Index





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC