fix sizehints bug

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@316 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-14 04:57:50 +00:00
parent e78ab55b5a
commit bf5e65a40d
3 changed files with 56 additions and 37 deletions

View File

@@ -101,6 +101,10 @@ int main() {
NULL);
MwWidget viewport = MwCreateWidget(MwViewportClass, "viewport", window, 5, 5, 630, 470 - 16 - 5);
hints.min_width = hints.max_width = 640;
hints.min_height = hints.max_height = 480;
MwVaApply(window, MwNsizeHints, &hints, NULL);
MwVaCreateWidget(MwLabelClass, "label", window, 5, 470 - 16 + 5, 630, 16,
MwNtext, "Press left click to draw triangle, right click to undo",
NULL);
@@ -111,10 +115,6 @@ int main() {
opengl = MwCreateWidget(MwOpenGLClass, "opengl", MwViewportGetViewport(viewport), 0, 0, 1024, 768);
hints.min_width = hints.max_width = 640;
hints.min_height = hints.max_height = 480;
MwVaApply(window, MwNsizeHints, &hints, NULL);
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
MwAddUserHandler(opengl, MwNmouseDownHandler, mouse, NULL);
MwAddUserHandler(opengl, MwNmouseMoveHandler, mouse_move, NULL);