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.
IndexProgramming Questions & HelpOther Libraries › G4P updated for Processing 1.1
Page Index Toggle Pages: 1
G4P updated for Processing 1.1 (Read 2273 times)
G4P updated for Processing 1.1
Mar 18th, 2010, 4:01pm
 
Processing 1.1 broke the G4P library due to changes in the PFont class.

Version 1.5.0 of G4P not only resolves this problem so that it works with 1.0.9 and 1.1 of Processing but has some new GUI components.

G4P can be downloaded from here.
Re: G4P updated for Processing 1.1
Reply #1 - Mar 18th, 2010, 8:38pm
 
Neat. Looking forward to checking out the new items. By any chance did the textfield code change much? I just finished writing a quick beta of a multi-line text control which is modified from your original text field.
Re: G4P updated for Processing 1.1
Reply #2 - Mar 19th, 2010, 12:43am
 
The changes made to G4P for Processing 1.1 were required because the size attibute in PFont was change from public to protected so was no longer accessable to G4P.

In G4P the font size is used to ensure that the textfield height is big enough to display the text, if you are doing something similar or if you need to know the PFont size then you will probably have to change your code for Processing 1.1

In G4P all fonts are created on the fly using createFont() so if I had a PFont object called myfont then to access the font height ...
Code:
// Processing 1.0.9
myfont.size;

// Processing 1.1
myfont.getFont().getSize();


This does not work with loadFont() and .vlw files since these are not based on a system font so getFont() returns a null value causing an exception.

NOTE: These changes do not affect the functionality of the G4P textfield component so that's OK.

Quote:
I just finished writing a quick beta of a multi-line text control which is modified from your original text field.


I would be very interested in seeing your multi-line component when it is done.

The new sliders were created by Andreas Freise and Daniel Brown because they wanted to use G4P but wanted some nice sliders to work with their library gwoptics I simply integrated them into the library.



Re: G4P updated for Processing 1.1
Reply #3 - Mar 19th, 2010, 8:05am
 
Ok, good to know, I was worried I'd have to go back and fix it if I updated to 1.1. Also, would you be interested in the code? It is nearly complete but would require some time to find any bugs. So far I've found it works as intended, but I only finished yesterday.
Re: G4P updated for Processing 1.1
Reply #4 - Mar 19th, 2010, 11:51am
 
I would be interested in looking at the code since G4P does not have a multi-line  component.

Quote:
It is nearly complete but would require some time to find any bugs


Perhaps once you done some debugging and make sure the code is well documented (commented) you can show it to me.

I can't promise to include it in the library, it depends on several factors not least how much work is involved in integrating it into G4P.  

As you can see full credit is given to G4P contributors.


Re: G4P updated for Processing 1.1
Reply #5 - Mar 19th, 2010, 7:29pm
 
The code is well documented and ready to go as-is, since it is working as intended for my application. I can't make any promises as far as the little bugs however, but I'm sure you know it is impossible to work them all out the first try. I am positive there are no glaring errors or problems though, since I've been trying everything possible to mess something up.

As far as integration, it would merely require renaming the class to GTextFieldM or something and adding it to the whole package. I'm not very Java-savvy when it comes to compiling libraries (I just started this week) but I'm sure it can be done.

As for recognition, just my name in the src file is fine, I added it when I started modifying so that's all taken care of. How would be the best way to get the code to you?
Re: G4P updated for Processing 1.1
Reply #6 - Mar 20th, 2010, 4:01am
 
I have modified my profile to have the email button so you can send it as an attachment.

Looking forward to seeing it.

Cheesy
Re: G4P updated for Processing 1.1
Reply #7 - Apr 13th, 2010, 8:17pm
 
nice that helped me
Page Index Toggle Pages: 1