27 lines
664 B
Text
27 lines
664 B
Text
include pGUI.e
|
|
|
|
function C_Keyed(Ihandle /*ih*/, atom /*c*/)
|
|
-- (Note without K_c below this does not respond to 'c', just 'C')
|
|
?"you pressed C"
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
procedure F2_keyed()
|
|
?"you pressed F2"
|
|
end procedure
|
|
|
|
function key_cb(Ihandle /*ih*/, atom c)
|
|
if c=K_F2 then F2_keyed()
|
|
elsif c=K_ESC then return IUP_CLOSE
|
|
end if
|
|
return IUP_DEFAULT
|
|
end function
|
|
|
|
IupOpen()
|
|
Ihandle dlg = IupDialog(IupLabel("hello"),"TITLE=\"Press F2\"")
|
|
IupSetCallback(dlg, "K_C", Icallback("C_Keyed"))
|
|
--IupSetCallback(dlg, "K_c", Icallback("C_Keyed"))
|
|
IupSetCallback(dlg, "K_ANY", Icallback("key_cb"))
|
|
IupShow(dlg)
|
|
IupMainLoop()
|
|
IupClose()
|