Hidden window problem on Linux
Archives Forums/MaxGUI Bug Reports/Hidden window problem on Linux
| ||
| Please see discussion here: http://www.blitzbasic.com/Community/posts.php?topic=98100 I've found a bug that affects Linux (I'm using Ubuntu) but not Windows. The following piece of code produces a "Segmentation Fault" when you execute it caused by the attribute WINDOW_HIDDEN. Strict Import MaxGui.Drivers Local window:TGadget = CreateWindow( "", 100, 100, 225, 400, Null, WINDOW_TITLEBAR | WINDOW_CENTER | WINDOW_CLIENTCOORDS | WINDOW_HIDDEN ) Local canvas:TGadget = CreateCanvas(1, 1, ClientWidth(window), ClientHeight(window), window) Attempting to work around this using Hidegadget() produces a different error. Take a look at this working code and then run it again after uncommenting the HIDEGADGET()/SHOWGADGET() lines:
Strict
Import MaxGui.Drivers
Local window:TGadget = CreateWindow( "", 100, 100, 225, 200, Null, WINDOW_TITLEBAR | WINDOW_CENTER | WINDOW_CLIENTCOORDS )
Local canvas:TGadget = CreateCanvas(1, 1, ClientWidth(window), ClientHeight(window), window)
'HideGadget( window)
'ShowGadget( window)
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETPAINT
SetGraphics CanvasGraphics (canvas)
DrawRect 20,20,50,80
Flip
End Select
Forever
End
It produces the following error: X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 14 (X_GetGeometry) Resource id in failed request: 0x2e00007 Serial number of failed request: 110 Current serial number in output stream: 110 BLITZMAX: 1.45 and 1.48 UBUNTU: 11.10 |
| ||
| Confirmed under Ubuntu 12.04 LTS (32-Bit). :( |