SimpleCxxLib packageclass GButton : public GInteractor
int main() {
GWindow gw;
GButton *button = new GButton("RED");
gw.addToRegion(button, "SOUTH");
while (true) {
GEvent e = waitForEvent(ACTION_EVENT | CLICK_EVENT);
if (e.getEventType() == MOUSE_CLICKED) break;
cout << "Please do not press this button again." << endl;
}
return 0;
}
| Constructor | |
Creates a GButton with the specified label. | |
GButton(string label);
GButton with the specified label. This
constructor also sets the action command for the button to the
label string.
Usage:
GButton *button = new GButton(label);