Basic Form Window Example

Just starting out? Need help? Post your questions and find answers here.
mypupdaisy
New User
New User
Posts: 4
Joined: Fri Jul 30, 2021 5:53 am

Basic Form Window Example

Post by mypupdaisy »

I have installed PureBasic on MacOS Big Sir 11.4 with a M1 MacBook. It is running great. I'm looking for a basic example that does nothing but opens a Window created in Form creator. I've looked around for a basic example and have not found one yet. The form will have nothing but a text box for now. Just trying to create the basic app with a Window that I can build from that.

When I Run/Compile, I get:
"Line 2: OpenHelloWorldWin() is not a function, array, list, map or macro."

Here's what I gleaned from various post and it fails.

Created main app: TestWindow.pb
Form: HelloWorldWin.pb

Code in TestWindow.pb

Code: Select all

XIncludeFile "HelloWorldWin.pbf"
OpenHelloWorldWin();
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
  EndSelect
Until Quit = 1
Thoughts?

Thanks in advance.

// Edit: Code-Tags added (Kiffi)
mypupdaisy
New User
New User
Posts: 4
Joined: Fri Jul 30, 2021 5:53 am

Re: Basic Form Window Example

Post by mypupdaisy »

FYI - This below works fine, but I wanted to use the Form editor and not sure how to get the HelloWorldWin.pb file I created with the Form creator to load instead.

Code: Select all

OpenWindow(1,200,100,500,500,"Test",#PB_Window_SystemMenu) 
; 
Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
// Edit: Code-Tags added (Kiffi)
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Basic Form Window Example

Post by Marc56us »

Created main app: TestWindow.pb
Form: HelloWorldWin.pb
Forms use extension .pbf
Be sure to use the correct file name with the relative or full path
:wink:
mypupdaisy
New User
New User
Posts: 4
Joined: Fri Jul 30, 2021 5:53 am

Re: Basic Form Window Example

Post by mypupdaisy »

Thanks for the reply.

I also found out since Im using the demo, it will not create the window. Have to purchase it to see it work. To bad, I don’t mind paying for it, but I wanted to make sure it would do what I wanted first.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Basic Form Window Example

Post by Marc56us »

mypupdaisy wrote: Sat Jul 31, 2021 5:58 pm Thanks for the reply.

I also found out since Im using the demo, it will not create the window. Have to purchase it to see it work. To bad, I don’t mind paying for it, but I wanted to make sure it would do what I wanted first.
You can use Form Designer in demo version. :)

Limitations of demo: See help (F1) Ordering
The demo-version of PureBasic is limited as shown below:
- No DLL can be created
- you can't use the whole external Win32 API support
- no development kit for external libraries
- maximum number of source lines: 800


Retry and follow help: Integrated form designer
Sample at bottom: Using the form designer in real world projects
https://www.purebasic.com/documentation ... _form.html

:wink:
mypupdaisy
New User
New User
Posts: 4
Joined: Fri Jul 30, 2021 5:53 am

Re: Basic Form Window Example

Post by mypupdaisy »

Did this... same error.

I just coded the window and it works fine.

Thanks
Post Reply