Page 1 of 2

[Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 12:51 pm
by littlebigman
Hello

I'm looking for an easy way to write Win32 applications in the case where .Net is a bit big and slow.

I found Freebasic a bit lacking (especially in documentation) and I don't like the way Powerbasic is managed (both the company and the general aggressive tone in the forum).

So I'd like to give PureBasic a try, but since no trialware is available, I can't check it out myself and have a couple of questions:

1. I see that PureBasic is cross-platform, while I'm only interested in writing simple Windows GUI applications. Is PB's Visual Editor really good and feels native, or should I expect quirks due to its cross-platform capability?

2. Do Windows GUI apps rely on native Windows widgets, or are they cross-platform widgets (eg. wxWidgets, etc.)?

Thank you.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:01 pm
by srod
Hi,

there is a trial version of PB available over at the main Purebasic site.

The latest version of PB (5.0) ships with a very nice form designer which is completely new and cross-platform (coded in Purebasic itself). There is a subforum of these forums given over to the designer.

All versions of Purebasic (whether for Windows or MacOSX etc.) utilise that platform's native widget set (Win API on Windows, AppKit on OSX Cocoa, GTK on Linux) and so you get the native look and feel regardless of which platform your apps run on. 3rd party widget sets like wxWidgets require you to import the relevant libraries etc. which wouldn't really be recommended. I know that ts-soft did a wrapper for wxWidgets some time back, but I am unsure if that is still in development?

You can't go wrong with PB. :)

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:19 pm
by Fred
Just wondering, how come you didn't find the trial ? Should i put a link on the main page ?

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:33 pm
by littlebigman
Thanks for the info. In the Download section, when I read "Registered users area: To access your personal account and download the full versions of PureBasic click here", I figured no trialware was available (clicked: "The login is the e-mail you used when you registered PureBasic.").

And when I read "free demo-version of PureBasic 5.00", I figured this was just a demo but not a trialware of the real thing. I just downloaded and installed that free demo-version, and it says: "Demo limitations: No Win32 API support, No DLL creation [...]"

Is there no time-limited full trial version of PB so I can start writing Win32 apps and check it out?

Thank you.

-----
Edit: The "demo" is OK to get started. Thanks for the help.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:40 pm
by srod
You can still write Win 32 apps using PB's native command set. You can certainly create decent GUIs without direct use of API.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:49 pm
by littlebigman
You mean going back to the Windows API itself à la Petzold?

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 1:55 pm
by srod
Well, the demo version does not allow you to use the Win API directly and so working à la Petzold is not an option in the demo version.

However, you can still create your GUIs etc. using the demo version since you still have access to all of PB's internal libraries such as the Window and Gadget libs. These wrap the relevant parts of the API and so you can create windows without the pain of using API.

You would do the same with the full version of PB. That is, you would use the window and gadget libs to create your GUI, but of course you would be free to dip into the API in order to tweak things a little if you so wished etc.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 2:02 pm
by littlebigman
Thanks for the input. So PB provides a .Net-like API on top of Win32, and the Visual Designer is just an easier way to draw GUIs than calling the PB API directly.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 2:06 pm
by PMV
littlebigman wrote:Is there no time-limited full trial version of PB so I can start writing Win32 apps and check it out?
There is a misunderstanding.
Win32 API means direct access to the underling Windows API on Windows.
Even with the Demo you can create full Windows, Linux and Mac Programs.

Especially as a beginner you will not need Win32 API for a long time :lol:
Thanks for the input. So PB provides a .Net-like API on top of Win32, and the Visual Designer is just an easier way to draw GUIs than calling the PB API directly.
No. PB has nothing to do with .NET ... it is just a language like C. :)
Internally it makes use of the OS specific functions itself, so you don't
need to access OS API yourself.

MFG PMV

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 2:08 pm
by srod
Here's some example code for opening a Window (taken from the PB manual) which will run in the demo version as it does not use any Win API.

Code: Select all

If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)

  Repeat
    Event = WaitWindowEvent()

    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf

  Until Quit = 1
  
EndIf

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 3:05 pm
by deeproot
srod wrote:You can't go wrong with PB. :)
- this is exactly right!

Personally I am making my Windows GUI directly by code only, because I find that it gives me the sort of control I like. I'm sure that the new Visual Designer is also good (haven't tried it yet) - so that gives a choice of methods. The normal PureBasic commands make it pretty easy to create even very complex GUI's by code. I occasionally use some API, but it's not needed for most things.

PureBasic's capability compares favorably with every other language product I've seen, regardless of cost.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 3:33 pm
by littlebigman
PMV wrote:No. PB has nothing to do with .NET ... it is just a language like C. :)
I understand. When I wrote ".Net-like API on top of Win32", I meant that it was possible to write GUI apps in PB without the Visual Designer by calling its API directly.

I'll experiment and see how it goes. Thanks all.

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 4:10 pm
by Zebuddi123
Hi littlebigman

Just a word of warning PureBasic and its forum is "HIGHLY ADDICTIVE". There is "NO KNOWN MEDICAL CURE" within days you will need a daily dose. Seriously it is a great language and very forgiving even with major cockups, probably the best forum in the world.

Couldnt recommend it enough!!!.


Zebuddi. :D

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Mon Nov 19, 2012 4:56 pm
by blueb
There are so many advantages over PowerBASIC, I really don't know where to start.

#1 - Pay for it once, and free updates forever (this is big)

#2 - PowerBASIC charges extra for 'Console' version

#3 - Able to download Windows AND Linux AND MacOS

#4 - 64 bit version available now

#5 - You can use Windows API functions directly by placing an underscore after the function name.
e.g. ClosePrinter_(hPrinter)
Note... MOST Api functions are 'pre-declared' in PureBasic

#6 - In PowerBASIC 'everything' seems to need the DECLARE statement
and even basic programs need INCLUDE statements
e.g. Include "win32api.inc"
PureBasic has done all of this for you.

#7 - This forum is especially valuable 8)

Re: [Pre-sale question] Writing Windows GUI apps?

Posted: Tue Nov 20, 2012 12:48 pm
by MachineCode
Zebuddi123 wrote:probably the best forum in the world
This is so true. I recently joined an iPhone forum, and the mods there were the most Hitler-like assholes you'd ever seen. One post wrong, and they'd be all over you like flies on crap. God help you if you said ANYTHING bad about Apple (like "Maps sucks now"). I was there for about 2 weeks before I just lost it with their attitude, and basically just told them all to F-off and to delete my account. A mod replied TWENTY SECONDS LATER with "Gladly". In other words, they just sit there monitoring everyone's posts, 24/7, ready to pounce on you! All the time I was thinking to myself how I wish it was as easy-going as the PureBasic forums. :)

I've had a few fights in these PureBasic forums before, and I know some people here hate my guts, but at least we don't get banned for trivial things, and hardly ever banned for even some major things. So what Zebuddi123 said above is true: it's a GREAT forum and community here.