From 82e10e6c945c891c0a898b5be75c603377fb32cb Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Wed, 5 Nov 2025 04:08:31 +0000 Subject: [PATCH] fix example git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@601 b9cfdab3-6d41-4d17-bbe4-086880011989 --- examples/basic/viewport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/basic/viewport.c b/examples/basic/viewport.c index 35f84d7..9a5544b 100644 --- a/examples/basic/viewport.c +++ b/examples/basic/viewport.c @@ -18,11 +18,18 @@ static void resize(MwWidget handle, void* user, void* call) { int main() { MwWidget w = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480, MwNtitle, "test", NULL); + MwLLPixmap px; vp = MwCreateWidget(MwViewportClass, "vp", w, 5, 5, 630, 470); + px = MwLoadImage(vp, "examples/picture.png"); + + if(px == NULL) px = MwLoadImage(vp, "../examples/picture.png"); + + if(px == NULL) px = MwLoadImage(vp, "picture.png"); + MwVaCreateWidget(MwImageClass, "image", MwViewportGetViewport(vp), 0, 0, 1024, 1024, - MwNpixmap, MwLoadImage(vp, "examples/picture.png"), + MwNpixmap, px, NULL); MwViewportSetSize(vp, 1024, 1024);