[REBOL] Re: Inform & keyboard
From: philb:upnaway at: 11-Jul-2002 0:56
Based on Volkers example I tried this .... no as nice as RT's request
(the size of the text field is hard coded for example)
but does the job I need ....
rebol [title: "OK Cancel Dialog box with keboard shortcuts"]
inform-kb: func [ip-text /local lay lv-ok] [
lay: layout [
vtext ip-text bold 300x24
button "OK" #"^M" [lv-ok: true hide-popup]
button "Cancel" #"^[" [lv-ok: false hide-popup]
inform lay [system/view/screen-face/size - lay/size / 2]
print inform-kb "This is a dialog box - Escape = Cancel Enter = OK"
=== Original Message ===
Am Mittwoch, 10. Juli 2002 16:09 schrieb [philb--upnaway--com]:
> Hi Guys,
> I have a problem with Rebol & Dialog boxes.
> I want to put up a dialog box and press Escape to cancel it or Enter to
> confirm it.
> But it looks like inform isnt compatible with keyboard input.
> Sensors dont seem to work and keyboard shortcuts on buttons dont work
> Its not a showstopper but would make my program more user friendly.
> Any ideas .... or does anyone have some example for me to study?
hotkeys are evaluated in system/view/window-feel.
and that is set automatic by 'view only for the first window.
one can set it by hand. try:
lay: layout [
tf: title "press control-t" 400
button "test" #"^t" [
tf/text: "you pressed the button or the key"
> Cheers Phil