Do you know this problem and possibly a solution?
If not do not think about it too much, I need analyse the problem further
and may come back to you with a more detailed question. I just though I
ask whether this is a known problem before I start my "investigations" ;-)
Thanks,
Michael
--
Please replace nospam by m.gerbracht when replying by e-mail
> I have encountered yet another toolbox problem that seems to be strange to
> me. I was developning a program using the toolbox on ROS 5 and it works
> fine on ROS 6, too. Now I tried to run the program on ROS 4 but it crashes
> when I try to open a window which needs redrawing. If I switch the option
> "Auto-redraw" on then the program runs but, of course, the window is
> empty.
This indeed suggests there is something wrong with the redraw routine of
your program. With Auto-redraw on the redraw handler is never called for
that window.
> If I untick the option then the program crashes before entering the
> redraw routine.
How do you know it crashes *before* entering the redraw handler?
> I have tried to install the latest toolbox modules from RISCOS Ltd.
> and the castle website but it did not help.
Does your app require the Nested Window Manager? Do you have it
installed on the RO 4 machine (WindowManager v 3.80 or later; type
"help windowmanager").
> Do you know this problem and possibly a solution?
Suggestions which come to mind:
- A problem in your redraw handler. The handler *is* entered and some
problem there causes the crash. Make sure whether the handler is
entered or not. Maybe with some blunt print messages to stderr, which
end up in a log file in the current path (as far as I can remember).
- A problem with the registration of the handler. Please copy the code
you use to register the handler. Check the return code of the
registration routine. If the registration failed, I'm not sure what
happens when a redraw event comes in. Probably nothing at all. BTW the
only possible reason for an error appears to be lack of memory.
--
Erik G http://www.xs4all.nl/~erikgrnh
== 'From:' address is a spam trap. Do not use
== See web site for email address
> Suggestions which come to mind:
> - A problem in your redraw handler. The handler *is* entered and some
> problem there causes the crash. Make sure whether the handler is
> entered or not. Maybe with some blunt print messages to stderr, which
> end up in a log file in the current path (as far as I can remember).
Yes, you were actually right. I did not have installed my debug tools on
the RISC OS 4 machine but I looked more deeply now. The error was not in
the redrawing routines as I first thought but in the part of code that is
called when a redraw request occurs.
The exact problem was with the wimp2toolbox call. I accidently used "0" as
second argument although I was not interested in the component ID. But the
window did not have any icon so it crashed on RISC OS 4 whereas the error
was ignored on RISC OS 5/6. So I changed this now to "-1" and everything
is fine.
Thanks for your help!