We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Text Area (Read 877 times)
Text Area
Jan 6th, 2009, 5:04pm
 
Does anyone have some example code for making a text area? I need to have a scrollable (both ways) text area.

I've been using the now deprecated SpringGUI library (love his buttons) and his text area can only have no scrollbars or a vertical scroll bar. I need both vertical and horizontal with no word wrap for displaying G-code in the ap I've been working on. (making a reprap gui)

Any help? If I have to start over, so be it. (~1300 lines of code)
Thanks.
Arvin

Re: Text Area
Reply #1 - Jan 6th, 2009, 5:26pm
 
Yes, I saw also that SpringGUI have been deprecated, perhaps it will make a comeback. I was planning to use it someday, because it supports pasting of text, while controlP5 wasn't (last time I checked, and I could be wrong!).
Looking at addTextArea() reference, I see it has a scrollBarPolicy of SCROLLBARS_BOTH. It doesn't work?

I just got the source, I wonder what it takes to make it compatible with 1.0.1.
Re: Text Area
Reply #2 - Jan 6th, 2009, 7:49pm
 
Didn't think to look at the source.

No the SCROLLBARS_BOTH errors. Acts like the enumeration was never implemented. In its place I can use an int but no matter what number I put there all I can get is zero scrollbars or a vertical one.

Guess I should download the source code. Naw, Too much on the todo list for a while. I'll have to wait a while.

Tried to email him but the only address I can find bounces.

Have you had a chance to look at the source? Could you see if you can find out about the scrollbars?

arvin
Re: Text Area
Reply #3 - Jan 6th, 2009, 9:48pm
 
The source is actually one unique big Java file. If I search the constant, I see:

 /** Constant for the scrollbar policy of TextAreas, ScrollPanes, etc. */
 final public int SCROLLBARS_BOTH = 0, SCROLLBARS_VERTICAL_ONLY = 1, SCROLLBARS_HORIZONTAL_ONLY = 2, SCROLLBARS_NONE = 3;

For some reason, they are not static, so you need to use gui.SCROLLBARS_BOTH.

Hey, I just tested a couple of examples, including allElements. They appear to work fine in 1.0.1, not sure why the library have been deprecated.
If I add gui.SCROLLBARS_BOTH to the addTextArea call, I see both scroll bars, and pasting text here activates them.
Re: Text Area
Reply #4 - Jan 7th, 2009, 4:08am
 
Woohoo!!! I was getting ready to just use a different language even though I had invested quite a bit of time doing it in Processing.

I don't like Java but Processing is cool.

Put the gui.SCROLLBARS_BOTH in and pasted some text and there the scrollbars were! Worked perfectly.

Thanks.
arvin
Re: Text Area
Reply #5 - Aug 7th, 2009, 11:38am
 
So have we decided that springGUI still works with the latest Processing build? Because I would love to use it for a current project, but don't want to go through the trouble if it won't work...
Page Index Toggle Pages: 1