int IupOpen(int *argc, char ***argv) { if (iup_opened) return IUP_OPENED; iup_opened = 1; if (!argc || !(*argc) || !argv) { argc = &iup_dummy_argc; argv = &iup_dummy_argv; } iupNamesInit(); iupFuncInit(); iupStrMessageInit(); iupGlobalAttribInit(); iupRegisterInit(); iupKeyInit(); iupImageStockInit(); IupSetLanguage("ENGLISH"); IupSetGlobal("VERSION", IupVersion()); IupSetGlobal("COPYRIGHT", IUP_COPYRIGHT); if (iupdrvOpen(argc, argv) == IUP_NOERROR) { char* value; iupdrvFontInit(); IupStoreGlobal("SYSTEM", iupdrvGetSystemName()); IupStoreGlobal("SYSTEMVERSION", iupdrvGetSystemVersion()); IupStoreGlobal("COMPUTERNAME", iupdrvGetComputerName()); IupStoreGlobal("USERNAME", iupdrvGetUserName()); IupSetGlobal("DEFAULTFONT", iupdrvGetSystemFont()); /* Use SetGlobal because iupdrvGetSystemFont returns a static string */ iupRegisterInternalClasses(); value = getenv("IUP_QUIET"); if (value && !iupStrBoolean(value)) /* if not defined do NOT print */ printf("IUP %s %s\n", IupVersion(), IUP_COPYRIGHT); value = getenv("IUP_VERSION"); if (iupStrBoolean(value)) iupVersionDlg(); return IUP_NOERROR; } else { #ifdef IUP_ASSERT /* can not use pre-defined dialogs here, so only output to console. */ fprintf(stderr, "IUP ERROR: IupOpen failed.\n"); #endif return IUP_ERROR; } }
void iupwinVersion(void) { Ihandle* dial, *ok; dial = IupDialog(IupVbox(IupFrame(IupVbox( IupLabel(IupVersion()), IupLabel(IUP_VERSION_DATE), IupLabel(IUP_COPYRIGHT), NULL)), ok = IupButton("Ok", NULL), NULL)); IupSetCallback(ok, "ACTION", (Icallback)ok_cb); IupSetAttribute(dial,IUP_TITLE,"IUP"); IupSetAttribute(dial,IUP_MENUBOX,IUP_NO); IupSetAttribute(dial,IUP_MINBOX,IUP_NO); IupSetAttribute(dial,IUP_MAXBOX,IUP_NO); IupSetAttribute(dial,IUP_RESIZE,IUP_NO); IupSetAttribute(dial,"GAP","5"); IupSetAttribute(dial,"MARGIN","5"); IupPopup(dial, IUP_CENTER, IUP_CENTER); IupDestroy(dial); }
void iupVersionDlg(void) { Ihandle* dlg; dlg = IupDialog(IupVbox(IupFrame(IupVbox( IupLabel(IupVersion()), IupLabel(IUP_VERSION_DATE), IupLabel(IUP_COPYRIGHT), NULL)), IupButton("OK", NULL), NULL)); IupSetAttribute(dlg,"TITLE","IUP Version"); IupSetAttribute(dlg,"DIALOGFRAME","YES"); IupSetAttribute(dlg,"DIALOGHINT","YES"); IupSetAttribute(dlg,"GAP","10"); IupSetAttribute(dlg,"MARGIN","10x10"); IupPopup(dlg, IUP_CENTER, IUP_CENTER); IupDestroy(dlg); }
static void setinfo (lua_State *L) { /* global table is at the stack */ lua_pushliteral (L, IUP_COPYRIGHT); lua_setfield(L, -2, "_COPYRIGHT"); lua_pushliteral (L, IUP_DESCRIPTION); lua_setfield(L, -2, "_DESCRIPTION"); lua_pushliteral (L, IUP_NAME); lua_setfield(L, -2, "_NAME"); lua_pushstring (L, IupVersion()); lua_setfield(L, -2, "_VERSION"); lua_pushliteral (L, IUP_VERSION_DATE); lua_setfield(L, -2, "_VERSION_DATE"); lua_pushinteger (L, IupVersionNumber()); lua_setfield(L, -2, "_VERSION_NUMBER"); }
static int Version(lua_State *L) { lua_pushstring(L, IupVersion()); return 1; }
static void Version(void) { lua_pushstring(IupVersion()); }