summaryrefslogtreecommitdiff
path: root/test/cube.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-10-19 20:16:01 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-10-20 11:28:08 +0200
commit757b5c12273cc1b4de8007b7c3f8536b699d2600 (patch)
tree21fcdda87a554f35c891ab8f1e4f8b513da9b96b /test/cube.cxx
parent143a18ee116c1b173522cb96aa7369e6b11eea48 (diff)
Fix ctrl/+/- in cube demo
- Fl_Grid: force layout() on resize() - needed for GL subwindows - test/cube.cxx: - use end() in constructor of class cube_box - ensure not to change the current group when adding a button
Diffstat (limited to 'test/cube.cxx')
-rw-r--r--test/cube.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/cube.cxx b/test/cube.cxx
index bd69bc42c..ad668a175 100644
--- a/test/cube.cxx
+++ b/test/cube.cxx
@@ -53,6 +53,7 @@ public:
double size;
double speed;
cube_box(int x,int y,int w,int h,const char *l=0) : Fl_Gl_Window(x,y,w,h,l) {
+ end();
lasttime = 0.0;
box(FL_DOWN_FRAME);
}
@@ -138,13 +139,16 @@ void show_info_cb(Fl_Widget*, void*) {
}
// overlay a button onto an OpenGL window (cube_box)
+// but don't change the current group Fl_Group::current()
void overlay_button(cube_box *cube) {
- cube->begin();
+ Fl_Group *curr = Fl_Group::current();
+ Fl_Group::current(0);
Fl_Widget *w = new Fl_Button(10, 10, 120, 30, "FLTK over GL");
w->color(FL_FREE_COLOR);
w->box(FL_BORDER_BOX);
w->callback(show_info_cb);
- cube->end();
+ cube->add(w);
+ Fl_Group::current(curr);
}
#endif // HAVE_GL