add icon to window

This commit is contained in:
Nishi 2025-11-21 19:21:27 +09:00
commit 68b39ed6d4
2 changed files with 8 additions and 0 deletions

View file

@ -28,6 +28,9 @@ void check_mail(void){
MwVaApply(image, MwVaApply(image,
MwNpixmap, full, MwNpixmap, full,
NULL); NULL);
MwVaApply(window,
MwNiconPixmap, full,
NULL);
} }
last = s.st_mtime; last = s.st_mtime;

View file

@ -41,6 +41,9 @@ static void mouseUp(MwWidget handle, void* user, void* client){
(void)user; (void)user;
(void)client; (void)client;
MwVaApply(window,
MwNiconPixmap, empty,
NULL);
MwVaApply(image, MwVaApply(image,
MwNpixmap, empty, MwNpixmap, empty,
NULL); NULL);
@ -60,6 +63,8 @@ int main() {
if(empty == NULL) empty = MwLoadXPM(window, mailempty); if(empty == NULL) empty = MwLoadXPM(window, mailempty);
if(full == NULL) full = MwLoadXPM(window, mailfull); if(full == NULL) full = MwLoadXPM(window, mailfull);
MwVaApply(window, MwNiconPixmap, empty, NULL);
image = MwVaCreateWidget(MwImageClass, "image", window, 0, 0, 128, 128, image = MwVaCreateWidget(MwImageClass, "image", window, 0, 0, 128, 128,
MwNpixmap, empty, MwNpixmap, empty,
NULL); NULL);