experimental changes to get it compiling on win16

This commit is contained in:
IoIxD 2026-08-09 14:06:19 -07:00
commit 336019b94d
30 changed files with 8582 additions and 8442 deletions

View file

@ -2,8 +2,16 @@
MwWidget fpicker;
MwWidget window;
MwWidget button;
/* This example does nothing on Win16 because we don't support the color picker on it (yet?) */
#ifdef __WINDOWS__
MwWidget missing_text;
#else
MwWidget button;
#endif
/* don't bother with color picker on win16 */
#ifndef __WINDOWS__
void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
char hexColor[8];
MwRGB* rgb = call_data;
@ -29,6 +37,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
MwSetText(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
}
#endif
int main() {
MwLibraryInit();
@ -37,12 +46,18 @@ int main() {
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
#ifndef __WINDOWS__
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
MwNtext, "change window background",
NULL);
MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL);
#else
missing_text = MwVaCreateWidget(MwLabelClass, NULL, window, 160, 180, 320, 120,
MwNtext, "Color picker doesn't yet exist on 16-bit Windows",
NULL);
#endif
MwLoop(window);
}