I'm having this exact problem. Create a canvas, SetGraphics() to it, and it works. Create another canvas, SetGraphics() to it, and all is well. Go back to the original canvas, SetGraphics() to it, and splat.
Some points:
1. Retrieving info from the canvas works ok; ie. GraphicsWidth() and GraphicsHeight() return the correct values.
2. Writing info to the canvas causes the splat.
This has got to be a bug within the MaxGUI runtime code. I'm working my way through the code right now, looking for the bug, but I'm quite unfamilier with the code, so it's taking some time.
I suspect that the core Gadget definition has a static variable in it somewhere, rather than a regular, stack-based variable, and when the context changes (or, in my case, I free the second canvas), the handle is getting a null or otherwise illegal value. BUT, I'm working my way through the code. Hopefully someone more familier with the code can have a look in this area.
Some points:
1. Retrieving info from the canvas works ok; ie. GraphicsWidth() and GraphicsHeight() return the correct values.
2. Writing info to the canvas causes the splat.
This has got to be a bug within the MaxGUI runtime code. I'm working my way through the code right now, looking for the bug, but I'm quite unfamilier with the code, so it's taking some time.
I suspect that the core Gadget definition has a static variable in it somewhere, rather than a regular, stack-based variable, and when the context changes (or, in my case, I free the second canvas), the handle is getting a null or otherwise illegal value. BUT, I'm working my way through the code. Hopefully someone more familier with the code can have a look in this area.