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);