Page 1 of 1

ImageGadget and ButtonImageGadget not working on Linux?

Posted: Mon Jan 12, 2026 11:14 am
by RBart
Hi
I am on Ubuntu 22.04 and Purebasic 6.20
When I run a form designed with the form designer. And it has a image or a button image. The program stops unexpected. I can't add it afterwards or even in a manually designed window. So it's probably me doing it the wrong way.

the code of de form:

Code: Select all

;
; This code is automatically generated by the Form Designer.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures need to be put in another source file.
;

Enumeration FormWindow
  #frmIssues
EndEnumeration

Enumeration FormGadget
  #Text_0
  #ButtonImage_1
EndEnumeration

Enumeration FormImage
  #Img_frmIssues_0
EndEnumeration

LoadImage(#Img_frmIssues_0,"/home/rudi/Apps/projecten/Issues/Preference.ico")


Procedure OpenfrmIssues(x = 0, y = 0, width = 600, height = 400)
  OpenWindow(#frmIssues, x, y, width, height, "", #PB_Window_SystemMenu) 
  ButtonImageGadget(#ButtonImage_1, 215, 115, 100, 25, ImageID(#Img_frmIssues_0))
EndProcedure

code to run the form

Code: Select all

;Design view frmIssues
IncludeFile "frmIssues.pbf"
Procedure frmIssues_close_window_handler() 
  End 
EndProcedure 
  OpenfrmIssues();
  ;LoadImage(123,"/home/rudi/Apps/projecten/EyeOpener/Preference.ico")
  ;ButtonImageGadget(#ButtonImage_1, 215, 115, 100, 25, ImageID(123))
  BindEvent(#PB_Event_CloseWindow, @frmIssues_close_window_handler(),#frmIssues)
Repeat : WaitWindowEvent() : ForEver
Many thanks in advance
Rudi

Re: ImageGadget and ButtonImageGadget not working on Linux?

Posted: Tue Jan 13, 2026 12:55 am
by mk-soft
File format "ico" files not support under linux. Use "png" files and UsePNGImageDecoder()

Re: ImageGadget and ButtonImageGadget not working on Linux?

Posted: Tue Jan 13, 2026 4:13 pm
by RBart
My fault, I have not read the documentation thoroughly.
There's a lot to read and learn. Step by step.
It changed to UsePNGImageDecoder() automaticly.
This is working fine now.

Thanks again mk-soft.
Greetings
Rudi