ImageGadget and ButtonImageGadget not working on Linux?

You need some new stunning features ? Tell us here.
User avatar
RBart
User
User
Posts: 35
Joined: Sun May 04, 2025 11:18 am

ImageGadget and ButtonImageGadget not working on Linux?

Post 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
💻 Exploring the world of PureBasic
User avatar
mk-soft
Always Here
Always Here
Posts: 6499
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ImageGadget and ButtonImageGadget not working on Linux?

Post by mk-soft »

File format "ico" files not support under linux. Use "png" files and UsePNGImageDecoder()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
RBart
User
User
Posts: 35
Joined: Sun May 04, 2025 11:18 am

Re: ImageGadget and ButtonImageGadget not working on Linux?

Post 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
💻 Exploring the world of PureBasic
Post Reply