LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2010, 07:42 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Automatically scrolling text box in PyGTK


I am playing around with PyGTK and come across a problem:

When I put a TextView inside a ScrolledWindow, and type text into the TextView until it reaches the edge, the cursor goes outside the viewport and I can't see what I'm typing.

How to make it so that the ScrolledWindow automatically scrolls so that the caret in the TextView is always in visible?
 
Old 01-04-2010, 08:23 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Also, how would I create a button with just the stock icon and not the label?
 
Old 01-04-2010, 09:45 AM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
With regards to your first question, you don't need a ScrolledWindow around a TextView - a TextView has built-in scroll bars (according to the PyGTK2.0 Reference).

http://library.gnome.org/devel/pygtk/stable/ Here's a link to the PyGTK2.0 Reference Manual - it's worth bookmarking.
 
Old 01-04-2010, 10:10 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I tried a TextView with no ScrolledWindow, but instead of scrollbars coming up, the window got bigger to fit the text.
 
Old 01-04-2010, 11:26 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Really it just doesn't work that way for me and I can't find a method that seems related to it.
 
Old 01-31-2010, 03:04 PM   #6
puk007
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Rep: Reputation: 0
I had the same problem, turns out, what I was doing was using "scrolledWindow.add_with_viewport(textView)". I removed that and simply used "scrolledWindow.add(textView)" and that fixed it for me

It's amazing how this has not been documented anywhere else.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenOffice Scrolling Through Text Fonts Murdock1979 Linux - Software 1 08-02-2008 06:27 PM
no scrolling text on shutdown radiodee1 Debian 2 12-29-2007 10:05 AM
Hor. scrolling text with perl or php @ngelot Programming 2 11-03-2004 08:06 AM
wrapping text and scrolling using ncurses questioner Programming 1 10-12-2003 11:29 AM
Scrolling in XDM Chooser Box using RedHat 7.1 jeanfey Linux - General 0 04-29-2002 04:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration