Domanda

Why I cannot resize the window once window.size() or window.resize() was called? How to fix this?

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
int main(int argc, char** argv) {
  Fl_Window window(0, 0, 110, 110);
  window.position(0, 0);
//  window.size(300, 300); <--uncomment this, and cannot resize window with the mouse!
  window.show(argc,argv);
  return Fl::run();
}
 
È stato utile?

Soluzione

size(width, height) is basically a shortcut to resize(x(), y(), width, height). It fixes the size of the widget.

If you want the window to be resizable, call

window.resizable(&window);

Have a look at subwindow.cxx in the test programs from the distribution tarball.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top