Hi Peter, here’s a simple working example. Only thing is, you’ll have to replace the missing image file by hand…
Note, I have not tested every single control in your library for this Z-order issue…only a few.
EDIT: have raised issue on SourceForge.
Thanks,
Mike
// Need G4P library
import g4p_controls.*;
// You can remove the PeasyCam import if you are not using
// the GViewPeasyCam control or the PeasyCam library.
import peasy.*;
public void setup(){
size(480, 320, JAVA2D);
createGUI();
customGUI();
// Place your setup code here
button1.setTip("This is a tooltip", GAlign.CENTER, GAlign.NORTH, 5);
button2.setTip("This is a tooltip", GAlign.CENTER, GAlign.NORTH, 5);
button3.setTip("This is a tooltip", GAlign.CENTER, GAlign.NORTH, 5);
button4.setTip("This is a tooltip", GAlign.CENTER, GAlign.NORTH, 5);
imgButton1.setTip("Yet another TT!", GAlign.CENTER, GAlign.NORTH, 5);
}
public void draw(){
background(230);
}
// Use this method to add additional statements
// to customise the GUI controls
public void customGUI(){
}
/* =========================================================
* ==== WARNING ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.
void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:
* Do not rename this tab!
* =========================================================
*/
public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:516716:
println("button1 - GButton >> GEvent." + event + " @ " + millis());
} //_CODE_:button1:516716:
public void dropList1_click1(GDropList source, GEvent event) { //_CODE_:dropList1:282382:
println("dropList1 - GDropList >> GEvent." + event + " @ " + millis());
} //_CODE_:dropList1:282382:
public void imgButton1_click1(GImageButton source, GEvent event) { //_CODE_:imgButton1:362407:
println("imgButton1 - GImageButton >> GEvent." + event + " @ " + millis());
} //_CODE_:imgButton1:362407:
public void button2_click1(GButton source, GEvent event) { //_CODE_:button2:683231:
println("button2 - GButton >> GEvent." + event + " @ " + millis());
} //_CODE_:button2:683231:
public void button3_click1(GButton source, GEvent event) { //_CODE_:button3:533149:
println("button3 - GButton >> GEvent." + event + " @ " + millis());
} //_CODE_:button3:533149:
public void button4_click1(GButton source, GEvent event) { //_CODE_:button4:952753:
println("button4 - GButton >> GEvent." + event + " @ " + millis());
} //_CODE_:button4:952753:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI(){
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setMouseOverEnabled(false);
surface.setTitle("Sketch Window");
button1 = new GButton(this, 197, 145, 80, 30);
button1.setText("Button");
button1.addEventHandler(this, "button1_click1");
dropList1 = new GDropList(this, 194, 183, 90, 80, 3, 10);
dropList1.setItems(loadStrings("list_282382"), 0);
dropList1.addEventHandler(this, "dropList1_click1");
imgButton1 = new GImageButton(this, 201, 115, 25, 25, new String[] { "aboutDownLarger.png", "aboutDownLarger.png", "aboutDownLarger.png" } );
imgButton1.addEventHandler(this, "imgButton1_click1");
button2 = new GButton(this, 236, 112, 50, 30);
button2.setText("Button");
button2.addEventHandler(this, "button2_click1");
button3 = new GButton(this, 156, 207, 80, 30);
button3.setText("Button");
button3.addEventHandler(this, "button3_click1");
label1 = new GLabel(this, 288, 183, 80, 20);
label1.setTextAlign(GAlign.CENTER, GAlign.MIDDLE);
label1.setText("My label");
label1.setOpaque(false);
button4 = new GButton(this, 287, 207, 80, 30);
button4.setText("Button");
button4.addEventHandler(this, "button4_click1");
}
// Variable declarations
// autogenerated do not edit
GButton button1;
GDropList dropList1;
GImageButton imgButton1;
GButton button2;
GButton button3;
GLabel label1;
GButton button4;
Here’s the image: