Fedora 43 fully installed

Should therefore also work with Fedora 42 ...
1. Download PureBasic free for Linux Ubuntu 24.04 (x64 - 64-bit)
2. Create folder Apps in Personal Folder
3. PureBasic unpacked in folder Apps
4. Developer Packages installed via Terminal
Gnome should no longer be needed (Obsolete)
sudo dnf install gcc gcc-c++ libstdc++ c++-gtk-utils-gtk2-devel gtk+ gtk+-devel gtk+extra gtk+extra-devel libXinerama libXinerama-devel SDL-devel unixODBC-devel c++-gtk-utils-gtk3-devel openssl-devel libXxf86vm-devel webkit2gtk4.1-devel
; Obsolete
; sudo dnf install libgnome-devel libgnomeui-devel
Examples of Windows, WebGadget and OpenGLGadget are running
Then start this once with PureBasic IDE to create the desktop file. Save in the specified folder!
After that, the IDE is in the start menu
Code: Select all
;-TOP
#ProgramTitle = "Create PureBasic Desktop File"
#ProgramVersion = "v1.01.2 by mk-soft"
Enumeration Windows
#Main
EndEnumeration
Enumeration MenuBar
#MainMenu
EndEnumeration
Enumeration MenuItems
#MainMenuAbout
#MainMenuExit
EndEnumeration
Enumeration Gadgets
#MainList
#MainButtonSave
EndEnumeration
Enumeration StatusBar
#MainStatusBar
EndEnumeration
; ----
Macro AddElementValue(List, Value)
AddElement(List) : List = Value
EndMacro
Global NewList Rows.s()
Procedure CreateDesktopFile()
Protected Name.s
Name = "PureBasic v" + Str(#PB_Compiler_Version / 100) + "." + LSet(Str(#PB_Compiler_Version % 100), 2, "0")
AddElementValue(Rows(), "[Desktop Entry]")
AddElementValue(Rows(), "Type=Application")
AddElementValue(Rows(), "Icon=" + #PB_Compiler_Home + "logo.png")
AddElementValue(Rows(), "Name=" + Name + " (gtk3)")
AddElementValue(Rows(), "Comment=Developer Utility")
AddElementValue(Rows(), "Exec=" + #PB_Compiler_Home + "compilers/purebasic")
AddElementValue(Rows(), "Path=" + #PB_Compiler_Home + "compilers")
AddElementValue(Rows(), "StartupNotify=false")
AddElementValue(Rows(), "Terminal=false")
AddElementValue(Rows(), "Categories=Development")
ForEach Rows()
AddGadgetItem(#MainList, -1, Rows())
Next
EndProcedure
Procedure SaveDesktopFile()
Protected path.s, filename.s, file.s
path = "/home/" + UserName() + "/.local/share/applications/"
If FileSize(path) <> -2
r1 = MessageRequester("Warning", "Path not exists. Create Path ?" + #LF$ + path, #PB_MessageRequester_Warning | #PB_MessageRequester_YesNo)
If r1 <> #PB_MessageRequester_Yes
ProcedureReturn 0
EndIf
If Not CreateDirectory(RTrim(path, "/"))
r1 = MessageRequester("Error", "Create Path " + path, #PB_MessageRequester_Warning | #PB_MessageRequester_YesNo)
ProcedureReturn 0
EndIf
EndIf
filename = path + "purebasic-v" + LSet(Str(#PB_Compiler_Version), 3, "0") + ".desktop"
file = SaveFileRequester("Save Desktop File", filename, "", 0)
If file
If CreateFile(0, file)
ForEach Rows()
WriteStringN(0, Rows())
Next
CloseFile(0)
Else
MessageRequester("Error", "File Not Saved!", #PB_MessageRequester_Error)
EndIf
EndIf
EndProcedure
; ----
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(#Main)
dy = WindowHeight(#Main) - StatusBarHeight(#MainStatusBar) - MenuHeight()
; Resize gadgets
ResizeGadget(#MainList, 5, 5, dx - 10, dy - 45)
ResizeGadget(#MainButtonSave, dx - 130, dy - 35, 120, 30)
EndProcedure
Procedure Main()
Protected dx, dy
#MainStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 800, 600, #ProgramTitle , #MainStyle)
; Menu
CreateMenu(#MainMenu, WindowID(#Main))
MenuTitle("&File")
MenuItem(#MainMenuAbout, "About")
MenuBar()
MenuItem(#MainMenuExit, "E&xit")
; StatusBar
CreateStatusBar(#MainStatusBar, WindowID(#Main))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(#Main)
dy = WindowHeight(#Main) - StatusBarHeight(#MainStatusBar) - MenuHeight()
ListViewGadget(#MainList, 5, 5, dx -10, dy - 45)
ButtonGadget(#MainButtonSave, dx - 130, dy - 35, 120, 30, "Save")
; Bind Events
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), #Main)
CreateDesktopFile()
; Event Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case #Main
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case #MainMenuAbout
MessageRequester("About", #ProgramTitle + #LF$ + #ProgramVersion, #PB_MessageRequester_Info)
Case #MainMenuExit
PostEvent(#PB_Event_CloseWindow, #Main, #Null)
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #MainList
Select EventType()
Case #PB_EventType_Change
;
EndSelect
Case #MainButtonSave
SaveDesktopFile()
EndSelect
EndSelect
ForEver
EndIf
EndProcedure : Main()