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.
IndexProcessing DevelopmentLibraries,  Tool Development › MyGUI Library Problem - GUI button not working
Page Index Toggle Pages: 1
MyGUI Library Problem - GUI button not working (Read 2228 times)
MyGUI Library Problem - GUI button not working
Mar 22nd, 2006, 7:31am
 
Hi,

When using the myGUI library I am not able to use the button class when I also have OPENGL or P3D enabled. Why is this, and is there a solution?

import processing.opengl.*;
import mkv.MyGUI.*;

//MyGUI gui;
MyGUI gui;
MyGUIButton button;

void setup() {
 size(300, 340, OPENGL);
 framerate(30);
 // Initiate objects
 gui = new MyGUI(this);
 button = new MyGUIButton(this, 30, 20, "Random", 40, 16);
 gui.add(button);
}

void draw() {
 }


void actionPerformed(ActionEvent e) {
 // React if the button object was pressed
 if(e.getSource() == button) {
 }
}

*Warning the above code causes my PApplet to freeze!*

If I remove OPENGL the code will run fine.

Thanks,

4dplane
Re: MyGUI Library Problem - GUI button not working
Reply #1 - Apr 2nd, 2006, 12:52am
 
Hi 4dplane,

As the developer of MyGUI, I'm afraid to say I don't know why OpenGL and P3D modes don't work. They used to (like in the 0068, or maybe 0085 days) but then Processing got a shiney overhaul and things broke again.

It might have something to do with loading in text files, or maybe its the way MyGUI tries to use the draw method to draw things - which ends up being incomptable with the OpenGL mode.

Its all a terrible shame because I was experimenting with 3D camera + 3D buttons at one stage.
Re: MyGUI Library Problem - GUI button not working
Reply #2 - Nov 2nd, 2006, 1:38am
 
i'm having the same issue; the error (at least initially) seems to come from the strokeCap() calls in, for example,

MyGUICheckBox.drawStates();

  _root.strokeCap(PApplet.MITER);

Caused by: java.lang.RuntimeException: strokeCap() not available with P3D

at processing.core.PGraphics3D.strokeCap(PGraphics3D.java:3110)

at processing.core.PApplet.strokeCap(PApplet.java:7478)

at mkv.MyGUI.MyGUICheckBox.drawStates(MyGUICheckBox.java:157)

at mkv.MyGUI.MyGUIObject.draw(MyGUIObject.java:310)

at mkv.MyGUI.MyGUIGroup.draw(MyGUIGroup.java:506)

... 10 more

-dc
Re: MyGUI Library Problem - GUI button not working
Reply #3 - Nov 2nd, 2006, 4:14am
 
just to verify, I recompiled MyGui version 0010 after removing  this line:

 _root.strokeCap(PApplet.MITER);

and it seems to run fine with the OPENGL renderer (I'm using MyGUI Sliders, Checkboxes, Labels, Buttons, & TextInputs).

cheers, -dc

Page Index Toggle Pages: 1