--> include pGUI.e Ihandle txt, increment, random, hbx, vbx, dlg function action_cb(Ihandle /*ih*/, integer ch) if not find(ch,"0123456789-") then return IUP_IGNORE end if return IUP_CONTINUE end function function increment_cb(Ihandle /*ih*/) integer v = IupGetInt(txt,"VALUE")+1 IupSetInt(txt,"VALUE",v) return IUP_CONTINUE end function function random_cb(Ihandle /*ih*/) if IupAlarm("Confirm","Replace wth random value?","Yes","No")=1 then IupSetInt(txt,"VALUE",rand(1000)) end if return IUP_CONTINUE end function IupOpen() txt = IupText(Icallback("action_cb"),"EXPAND=YES") increment = IupButton("increment",Icallback("increment_cb")) random = IupButton("random",Icallback("random_cb")) hbx = IupHbox({increment,random},"MARGIN=0x10, GAP=20") vbx = IupVbox({txt,hbx},"MARGIN=40x20") dlg = IupDialog(vbx) IupShow(dlg) if platform()!=JS then IupMainLoop() IupClose() end if