I tried this and when I enter some data into the editor gadget and I pressed <Enter> it just inserts a blank line in the EditorGadget instead of calling saveData().
Here is the code that I used:
Code: Select all
OpenWindow(#mainWindow, 0, 0, 780, 498, "", wFlags)
SetWindowColor(#mainWindow, RGB(245,245,245))
AddKeyboardShortcut( #mainWindow, #PB_Shortcut_Return, #kbdEnterKey)
setupMainScreen()
;--------[ Wait for window event ]--------
Repeat
Select WaitWindowEvent() ;Wait for an event
Case #PB_Event_CloseWindow ;Close window if "X" is clicked.
run = 1 ;Set run flag to 1
Case #PB_Event_Menu
Select EventMenu()
Case #kbdEnterKey
result = GetActiveGadget()
If result = 14 ;14 is the #editorFLD gadget
saveData()
clearGadgets()
EndIf
EndSelect
Case #PB_Event_Gadget ;Check for gadget event
Select EventGadget()
......