Page 1 of 1

SetGadgetAttribute-Canvas, Button_Image_32Bit_Crash 573 Mint

Posted: Fri Feb 12, 2021 3:25 pm
by Saki
Linux like the 32bit images not, crash, Win and Mac OK

Code: Select all

window_ID=OpenWindow(#PB_Any, 0, 0, 400, 400, "")
canvas_ID=CanvasGadget(#PB_Any, 0, 0, 400, 400)
image_ID=CreateImage(#PB_Any, 400, 400, 32, $FF)
SetGadgetAttribute(canvas_ID, #PB_Button_Image, ImageID(image_ID))
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

Re: SetGadgetAttribute-Canvas, Button_Image_32Bit_Crash 573

Posted: Fri Feb 12, 2021 11:43 pm
by Shardik
I can confirm the problem with Saki's example on my Linux Mint 19.3 'Tricia' x64 with Cinnamon while i can also confirm that the example is running like a charm on MacOS 11.2.1 'Big Sur' and Windows.

Technically the use of #PB_Button_Image in a SetGadgetAttribute() for a CanvasGadget is incorrect (instead of #PB_Button_Image a CanvasGadget supports #PB_Canvas_Image according to CanvasGadget's help). But in PureBasic for Linux, MacOS and Windows #PB_Button_Image and #PB_Canvas_Image are both defined as 1, so this can't explain the problem on Linux.

In Linux Mint 'Tricia' I don't get a crash but the following warning:
"[WARNING] GdkPixbuf (CRITICAL): gdk_pixbuf_copy_area: assertion '!(gdk_pixbuf_get_has_alpha (src_pixbuf) && !gdk_pixbuf_get_has_alpha (dest_pixbuf))' failed"