OPTION GUI TRUE PRAGMA GUI cdk DECLARE item[] = { "one", "two", "three", "four" } TYPE char const* DECLARE menus[MAX_MENU_ITEMS][MAX_SUB_ITEMS] TYPE char const* menus[0][0] = "File" menus[0][1] = "Open " menus[0][2] = "Save " menus[0][3] = "Save As " menus[0][4] = "Quit " menus[1][0] = "Edit" menus[1][1] = "Copy " menus[1][2] = "Cut " menus[1][3] = "Paste " DECLARE submenu[] = { 5, 4 } TYPE int DECLARE sloc[] = { LEFT, LEFT } TYPE int id = GUIDEFINE(" \ { type=window name=screen } \ { type=menu name=menu args=screen,menus,2,submenu,sloc,TOP,A_BOLD|A_UNDERLINE,A_REVERSE } \ { type=mentry name=mentry args=screen,4,4,\"Text:\",\"\",A_BOLD,32,vMIXED,50,10,2,0,1,1 callback=KEY_ESC,esc } \ { type=calendar name=calendar args=screen,61,5,\"Calendar\",12,6,2020,A_BOLD,A_BOLD,A_BOLD,A_BOLD,1,1 callback=KEY_ENTER callback=KEY_ESC,esc } \ { type=button name=button args=screen,4,18,\"This is NOK\",NULL,1,1 callback=KEY_ENTER callback=KEY_ESC,esc } \ { type=button name=exit args=screen,23,18,\" EXIT \",NULL,1,1 callback=KEY_ENTER callback=KEY_ESC,esc } \ { type=entry name=entry args=screen,13,23,\"Information:\",\"\",A_BOLD,95,vMIXED,20,0,20,1,1 callback=KEY_ENTER callback=KEY_ESC,esc } \ { type=scroll name=scroll args=screen,43,18,RIGHT,10,20,\"\",item,4,TRUE,A_BOLD,1,1 callback=KEY_ESC,esc } \ ") CALL GUISET(id, "button", Button, " BLUE ", TRUE) CALL GUISET(id, "button", ObjectBackgroundColor, "") CALL GUISET(id, "mentry", MentryValue, "Press to get into the menu and press to switch widget") x = 0 DECLARE bla TYPE CDKOBJS* DECLARE dir TYPE STRING WHILE TRUE event$ = GUIEVENT$(id) SELECT event$ CASE "esc" action = activateCDKMenu(GUIWIDGET(id, "menu"), 0) IF action = 3 THEN END CASE "button" bla=(CDKOBJS*)GUIWIDGET(id, "button") 'PRINT bla->fn->objectType, "===", vBUTTON 'dir$ = GUIGET(id, "entry", EntryValue) CASE "exit" CALL GUIGET(id, "entry", EntryValue, &dir) SAVE dir TO "/tmp/log.txt" END ENDSELECT WEND