Wrong usage/parameters at WaitEvent on AmigaOS - window opens correctly, crash before user interaction
Posted: Sun May 31, 2026 9:54 pm
Hi,
I'm developing a RapaGUI 2.2 application (Fotografista, a photo editor) compiled with Hollywood 11, targeting Windows, macOS ARM, and AmigaOS. I'm experiencing a crash on AmigaOS that I cannot reproduce on Windows or macOS.
Error message:
"Wrong usage/parameters for this command! Read the documentation!"
File: fotografista.hws (current line: 83 - In function: WaitEvent)
Observations:
- The main window opens correctly (title bar, scrollcanvas with border scroller, statusbar all visible)
- The crash occurs immediately after the window opens, before any user interaction
- The same error message appears on Windows when InstallEventHandler is missing — suggesting WaitEvent receives an event it cannot handle
- The application works correctly on Windows and macOS
- Reproduced on both AmiKit (emulated AmigaOS 3.x) and native AmigaOS 4.1 on X5000 hardware
Main loop (fotografista.hws):
p_InitLanguage() (i18n.hws):
Window XML (relevant fragment):
Hypotheses already tested and excluded:
- InstallEventHandler position and parameters
- OnRawKeyDown / OnRawKeyUp availability on AmigaOS
- moai.Set() inside Paint callback (moved to RunCallback)
- help= attribute on menu items (removed, no change)
- Nested submenus (3 levels deep under Eksperymentalne)
- Incorrect XML (quotes in item text)
- fontsize/height attributes on statusbar
- Missing Catalogs directory at runtime
- @FILE / OpenCatalog logic
- p_SetMenusEnabled iterating menu IDs
- All menu IDs verified present in XML
Question:
What could cause "Wrong usage/parameters for this command" at WaitEvent on AmigaOS, when the window opens correctly and InstallEventHandler is called with a valid RapaGUI handler, but the crash occurs immediately on the first WaitEvent call?
Is there anything specific to AmigaOS/MUI that could trigger this — perhaps a Paint event fired before WaitEvent that causes a re-entrant call, or a specific GUI attribute that MUI handles differently?
Thank you.
I'm developing a RapaGUI 2.2 application (Fotografista, a photo editor) compiled with Hollywood 11, targeting Windows, macOS ARM, and AmigaOS. I'm experiencing a crash on AmigaOS that I cannot reproduce on Windows or macOS.
Error message:
"Wrong usage/parameters for this command! Read the documentation!"
File: fotografista.hws (current line: 83 - In function: WaitEvent)
Observations:
- The main window opens correctly (title bar, scrollcanvas with border scroller, statusbar all visible)
- The crash occurs immediately after the window opens, before any user interaction
- The same error message appears on Windows when InstallEventHandler is missing — suggesting WaitEvent receives an event it cannot handle
- The application works correctly on Windows and macOS
- Reproduced on both AmiKit (emulated AmigaOS 3.x) and native AmigaOS 4.1 on X5000 hardware
Main loop (fotografista.hws):
Code: Select all
p_InitLanguage() ; calls moai.CreateApp(), InstallEventHandler(), moai.Notify()
LoadBrush(10, "icons/icon128.png")
p_PrefsLoad()
p_SetMenusEnabled(False)
Repeat
WaitEvent
ForeverCode: Select all
Function p_InitLanguage()
If IsNil(g_prefs.lang$) Then g_prefs.lang$ = "polish"
If g_prefs.lang$ <> "polish"
p_WriteCatalogFile(g_prefs.lang$)
OpenCatalog("Fotografista.catalog")
EndIf
g_current_lang$ = g_prefs.lang$
moai.CreateApp(g_gui_xml$)
moai.Set("sb", "fontsize", g_prefs.ui_font_size)
InstallEventHandler({
RapaGUI = p_EventFunc,
OnRawKeyDown = Function(msg)
If msg.Key = "LSHIFT" Or msg.Key = "RSHIFT" Then g_shift_down = True
EndFunction,
OnRawKeyUp = Function(msg)
If msg.Key = "LSHIFT" Or msg.Key = "RSHIFT" Then g_shift_down = False
EndFunction
})
moai.Notify("canvas", "MouseLeft", True)
moai.Notify("canvas", "MouseMove", True)
moai.Notify("canvas", "MouseRight", True)
EndFunctionCode: Select all
xml
<window id="mainwin" title="Fotografista@i18n:187" sizegadget="true"
width="900" height="650" remember="true"
menubar="mainmenu"
notify="closerequest; sizechange"
usebottomborderscroller="true"
userightborderscroller="true">
<vgroup>
<scrollcanvas id="canvas" autoscale="false"
virtwidth="1" virtheight="1"
weight="100"
usewinborder="true"
notify="paint"/>
<statusbar id="sb" fontsize="14" height="32">
<item id="sb_filename" i18n="188">Brak obrazu</item>
<item id="sb_size"/>
<item id="sb_format"/>
<item id="sb_zoom"/>
<item id="sb_undo"/>
<item id="sb_sel"/>
</statusbar>
</vgroup>
</window>- InstallEventHandler position and parameters
- OnRawKeyDown / OnRawKeyUp availability on AmigaOS
- moai.Set() inside Paint callback (moved to RunCallback)
- help= attribute on menu items (removed, no change)
- Nested submenus (3 levels deep under Eksperymentalne)
- Incorrect XML (quotes in item text)
- fontsize/height attributes on statusbar
- Missing Catalogs directory at runtime
- @FILE / OpenCatalog logic
- p_SetMenusEnabled iterating menu IDs
- All menu IDs verified present in XML
Question:
What could cause "Wrong usage/parameters for this command" at WaitEvent on AmigaOS, when the window opens correctly and InstallEventHandler is called with a valid RapaGUI handler, but the crash occurs immediately on the first WaitEvent call?
Is there anything specific to AmigaOS/MUI that could trigger this — perhaps a Paint event fired before WaitEvent that causes a re-entrant call, or a specific GUI attribute that MUI handles differently?
Thank you.