Why FLTK window become unresizable with mouse after resize() was called?

StackOverflow https://stackoverflow.com/questions/21170098

  •  28-09-2022
  •  | 
  •  

문제

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();
}
 
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top