My First Post - Hello
-
MikeGreen99
- New User

- Posts: 6
- Joined: Wed Dec 03, 2025 5:40 pm
My First Post - Hello
Ubuntu Unity 24.04 PureBasic 6.21
Hi.
I am a retired electrical engineer who made a career designing and programming computer systems. I have 'played' with Visual Basic and QuickBasic for many years. I have dabbled in assembler, C, and the mighty Python. Now I'm toying with PureBasic, and I really like it. It will become my go to language for most of my future programming needs.
By the way, I had difficulties registering for this forum. The system would not accept my entered info. I tried multiple times. Finally, I tried disabling Privacy Badger, and it worked. Go figure.
Have a nice day,
Mike from the 1000 Islands, Ontario, Canada
Hi.
I am a retired electrical engineer who made a career designing and programming computer systems. I have 'played' with Visual Basic and QuickBasic for many years. I have dabbled in assembler, C, and the mighty Python. Now I'm toying with PureBasic, and I really like it. It will become my go to language for most of my future programming needs.
By the way, I had difficulties registering for this forum. The system would not accept my entered info. I tried multiple times. Finally, I tried disabling Privacy Badger, and it worked. Go figure.
Have a nice day,
Mike from the 1000 Islands, Ontario, Canada
Re: My First Post - Hello
Welcome, good to have you here 
Re: My First Post - Hello
Wellcome 
I've been with PureBasic for over 20 years. Some programs and services have been running on various systems for a very long time.
It's worth working with it. Even if you first have to learn that a few things go differently than you were used to with VB6.
P.S.
Before you work with the FormDesigner you should write the windows and gadgets by hand.
Since every start is difficult to understand the event management of PureBasic I have put my template to test.
I've been with PureBasic for over 20 years. Some programs and services have been running on various systems for a very long time.
It's worth working with it. Even if you first have to learn that a few things go differently than you were used to with VB6.
P.S.
Before you work with the FormDesigner you should write the windows and gadgets by hand.
Since every start is difficult to understand the event management of PureBasic I have put my template to test.
Code: Select all
;-TOP
#ProgramTitle = "Main Window"
#ProgramVersion = "v1.01.2"
Enumeration Windows
#Main
EndEnumeration
Enumeration MenuBar
#MainMenu
EndEnumeration
Enumeration MenuItems
#MainMenuAbout
#MainMenuExit
EndEnumeration
Enumeration Gadgets
#MainEdit
#MainButtonOk
#MainButtonCancel
EndEnumeration
Enumeration StatusBar
#MainStatusBar
EndEnumeration
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(#Main)
dy = WindowHeight(#Main) - StatusBarHeight(#MainStatusBar) - MenuHeight()
; Resize gadgets
ResizeGadget(#MainEdit, 5, 5, dx - 10, dy - 45)
ResizeGadget(#MainButtonok, 10, dy - 35, 120, 30)
ResizeGadget(#MainButtonCancel, 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")
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
MenuItem(#PB_Menu_About, "")
CompilerElse
MenuItem(#MainMenuAbout, "About")
CompilerEndIf
; Menu File Items
CompilerIf Not #PB_Compiler_OS = #PB_OS_MacOS
MenuBar()
MenuItem(#MainMenuExit, "E&xit")
CompilerEndIf
; StatusBar
CreateStatusBar(#MainStatusBar, WindowID(#Main))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(#Main)
dy = WindowHeight(#Main) - StatusBarHeight(#MainStatusBar) - MenuHeight()
EditorGadget(#MainEdit, 5, 5, dx -10, dy - 45)
ButtonGadget(#MainButtonok, 10, dy - 35, 120, 30, "Ok")
ButtonGadget(#MainButtonCancel, dx - 130, dy - 35, 120, 30, "Abbruch")
; Bind Events
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), #Main)
; Event Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case #Main
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
Case #PB_Menu_About
PostEvent(#PB_Event_Menu, #Main, #MainMenuAbout)
Case #PB_Menu_Preferences
Case #PB_Menu_Quit
PostEvent(#PB_Event_CloseWindow, #Main, #Null)
CompilerEndIf
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 #MainEdit
Select EventType()
Case #PB_EventType_Change
;
EndSelect
Case #MainButtonOk
;
Case #MainButtonCancel
;
EndSelect
EndSelect
ForEver
EndIf
EndProcedure : Main()
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
-
MikeGreen99
- New User

- Posts: 6
- Joined: Wed Dec 03, 2025 5:40 pm
Re: My First Post - Hello
Thanks for the responses.
Writing the windows and gadgets by hand looks pretty formidable to me. I will delve into it shortly.
However, yesterday I was playing with the built in FormDesigner and got an error.
I will discuss this on another post entitled: "Not a function, Array, List, Map Or Macro"
Thanks,
M....
Writing the windows and gadgets by hand looks pretty formidable to me. I will delve into it shortly.
However, yesterday I was playing with the built in FormDesigner and got an error.
I will discuss this on another post entitled: "Not a function, Array, List, Map Or Macro"
Thanks,
M....
Re: My First Post - Hello
Oh? No errors with runprogram? You must be running windows… WELCOME ANYWAY!MikeGreen99 wrote: Wed Dec 03, 2025 9:17 pmyesterday I was playing with the built in FormDesigner and got an error.
-
MikeGreen99
- New User

- Posts: 6
- Joined: Wed Dec 03, 2025 5:40 pm
Re: My First Post - Hello
I use ubuntu unity.
I haven't used Windows for the past 15 years, and proud of it
.
Thanks,
M...
I haven't used Windows for the past 15 years, and proud of it
Thanks,
M...
Re: My First Post - Hello
Yes, roll your own guis until you have a better understanding of the event loop and callbacks or bindgadgetevents.
So much easier than VB6.
You can see it all in your source text instead of miles of property boxes and trees.
Also have a look at threading examples early to avoid your gui appearing hung.
There is no magic DoEvents() like VB6, as if that really worked anyway.
Always use EnableExplicit.
Arrays start at 0.
Strings are slower than VB6, but only if you have medium to large counts.
Happy coding!
So much easier than VB6.
You can see it all in your source text instead of miles of property boxes and trees.
Also have a look at threading examples early to avoid your gui appearing hung.
There is no magic DoEvents() like VB6, as if that really worked anyway.
Always use EnableExplicit.
Arrays start at 0.
Strings are slower than VB6, but only if you have medium to large counts.
Happy coding!
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: My First Post - Hello
From one newish PureBasic user to another, I have been using the built-in Form Designer with success and think it is better than having to figure out the position and size of on screen stuff by hand. The way the Form Designer sets up events seems to be disliked by some, who are much, much more experienced than me, so I won't argue, but it has worked just fine for me.MikeGreen99 wrote: Wed Dec 03, 2025 9:17 pm Writing the windows and gadgets by hand looks pretty formidable to me.
Re: My First Post - Hello
I would also disable the #PB_Any setting in FormDesigner. I think it's better to use constants with enumerations for the GUI instead of lots of variables.
I'm one of those who don't like FormDesigner's event handling either.
Otherwise, I also like to use FormDesigner (without #PB_Any) to create multiple windows.
Since I am actually lazy when it comes to writing, I use my EventDesigner to get all windows into one programme
and create all the necessary event procedures and management.
See signature.

I'm one of those who don't like FormDesigner's event handling either.
Otherwise, I also like to use FormDesigner (without #PB_Any) to create multiple windows.
Since I am actually lazy when it comes to writing, I use my EventDesigner to get all windows into one programme
and create all the necessary event procedures and management.
See signature.
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: My First Post - Hello
I'm sure that coding styles are personal choices, but PureBasic's humble #PB_Any directive hides a very powerful dynamic object numbering system, which prevents inadvertent overlappings, especially in larger projects with multiple included files.mk-soft wrote: Fri Dec 05, 2025 9:20 am...disable the #PB_Any setting in FormDesigner. I think it's better to use constants with enumerations for the GUI instead of lots of variables.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 
Re: My First Post - Hello
For constants, FormDesigner uses Named Enumeration. For different form files, you also have to use different names for constants and variables to avoid conflicts. With constants, however, you can use virtual function tables for event management and indirectly call up the event procedures. In the case of variables, you have to query each one individually.
With my EventDesigner, the constants are extended with a prefix. Thus, there are no conflicts with the constants and event procedure are called to the virtual table.
With my EventDesigner, the constants are extended with a prefix. Thus, there are no conflicts with the constants and event procedure are called to the virtual table.
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: My First Post - Hello
For large multi-codebase projects, even named enumerations could pose a problem if the various enumerator labels don't align. And with #PB_Any, the uniqueness of the variable names cannot be guaranteed either, prefixed or not.mk-soft wrote: Fri Dec 05, 2025 6:06 pmFor constants, FormDesigner uses Named Enumeration. For different form files, you also have to use different names for constants and variables to avoid conflicts.
So, modules were born.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 
Re: My First Post - Hello
Welcome - I've been playing with PureBasic on and off for the last 5 years but finally wrote a "real" application with it this year! 
Gary E Chike DMD MS
Medical Illustrator & Digital Transformational Technologist
Bridging clinical education, design, and digital transformation.
Medical Illustrator & Digital Transformational Technologist
Re: My First Post - Hello
Welcome Mike, with your background, you'll quickly learn PureBasic and it's just amazing, and the more you use it, the more you'll like it.
As PureForm has been discussed, it's probably not the best tool to start with and unlock the full potential of PureBasic, it's a bit outdated, but with practice, it can do the job and it is multi-platform.
Apologies for this little ad but If you wish, you can try the demo version of my Designer (full-featured but limited to 16 Gadgets in demo). It is developed for Windows only but should work using Wine on Linux.
As PureForm has been discussed, it's probably not the best tool to start with and unlock the full potential of PureBasic, it's a bit outdated, but with practice, it can do the job and it is multi-platform.
Apologies for this little ad but If you wish, you can try the demo version of my Designer (full-featured but limited to 16 Gadgets in demo). It is developed for Windows only but should work using Wine on Linux.
Re: My First Post - Hello
Maybe that's a bit too much… anyway:MikeGreen99 wrote: Thu Dec 04, 2025 10:59 pm I use ubuntu unity.
I haven't used Windows for the past 15 years, and proud of it.



