add:resizable
This commit is contained in:
parent
8e9429f349
commit
63015dea50
22
main.cpp
22
main.cpp
@ -1,5 +1,6 @@
|
|||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Box.H>
|
#include <FL/Fl_Box.H>
|
||||||
|
#include <FL/Fl_Button.H>
|
||||||
#include <FL/Fl_Pack.H>
|
#include <FL/Fl_Pack.H>
|
||||||
#include <FL/Fl_Window.H>
|
#include <FL/Fl_Window.H>
|
||||||
|
|
||||||
@ -40,7 +41,26 @@ int demo1(int argc, char** argv)
|
|||||||
return Fl::run();
|
return Fl::run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int demo2()
|
||||||
|
{
|
||||||
|
auto* dialog = new Fl_Window(300, 100);
|
||||||
|
auto* icon = new Fl_Box(0, 0, 50, 50, "!");
|
||||||
|
auto* text = new Fl_Box(50, 0, 250, 40, "Out of Memory Error");
|
||||||
|
auto* btns = new Fl_Group(50, 50, 250, 50); // parent group
|
||||||
|
auto* darn = new Fl_Button(200, 50, 100, 50, "Darn!");
|
||||||
|
auto* R = new Fl_Box(50, 50, 150, 50); // "invisible" box "R"
|
||||||
|
R->hide(); // make sure it's invisible
|
||||||
|
btns->resizable(R); // make "R" parent group resizable
|
||||||
|
btns->end();
|
||||||
|
dialog->resizable(darn);
|
||||||
|
dialog->end();
|
||||||
|
dialog->show();
|
||||||
|
// 运行事件循环
|
||||||
|
return Fl::run();
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
demo1(argc, argv);
|
// demo1(argc, argv);
|
||||||
|
demo2();
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user