2014-10-18 16:10:26

I'm considering the purchase of PureBasic. Before I download it, I'd just like to know how easy/hard it is to build a GUI in it. Do you need to understand technical stuff about how stuff is visually presented on the screen, or is there a way to have the language take care of all that for you, so you can easily build something that looks good? I know some people love PureBasic and others hate it, I'm not asking about that. Anything else PB is particularly good/bad at?

2014-10-18 18:12:03

@Jaybird, PureBASIc is quite simple for building GUIs in it. Here's a sample one for you:
If OpenWindow (0, #pb_ignore, #pb_ignore, #pb_ignore, #pb_ignore, "Test")
ButtonGadget (0, #PB_Ignore, #PB_Ignore, 25, 25, "Go")
; this is a comment. This is how we handle events:
Repeat
event = WaitWindowEvent()
if event = #PB_Event_Gadget
event = EventGadget()
if event = 0
; code here
EndIf
EndIf
EndIf
Delay(5)
Until event = #PB_Event_CloseWindow
That's how you do it! Just keep adding buttons and other gadgets to that simple window and then keep adding clauses to the If statement, and your good to go!

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-10-18 23:16:52

Keep in mind that you do have to position objects using pixel coordinates. I'm not sure if pure basic has flow layout panels or anything however.

Deep in the human unconscious is a pervasive need for a logical universe that makes sense. But the real universe is always one step beyond logic.

2014-10-19 02:33:00

You don't exactly need to position coordinates. It will do fine if you set it all to 0 0 0 0, just sited users won't be able to see what your doing then. For a game it would be something like this. if OpenScreen(640, 480, 16, "snow race") Repeat ExamineKeyboard() if KeyBoardPushed(#pb_key_escape) end endif Delay(5) Forever. Not the best exampple, but it should help.

Check out the new reality software site. http://realitysoftware.noip.us

2014-10-19 02:58:03

Does that work with jaws?  I know it works with NVDA, but can't help but feel that it would be incredibly screen reader specific or fail for some controls.
In general, autolayout of one sort or another is a godsend beyond all description.

My Blog
Twitter: @ajhicks1992

2014-10-19 05:50:10

@camlorn, yes, it would work with JAWS. It does have some issues, though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-10-19 09:55:56

PB 5 and newer has a dialog library that lets you create dialogs from XML files,so you don't have to deal with coordinates anymore.

<Insert passage from "The Book Of Chrome" here>

2014-10-22 14:53:21

I would not recommend you use that since you have to include the XML file in the main program directory, and another person who knows XML can modify the dialog if they want, although they can't modify the internal code of the program.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-10-22 15:57:04

Why do you care?
I mean...I can't modify your logic, I can modify your GUI, but that's not going to do me any good.  This whole "nothing can be modified" philosophy I see around here is probably one of the causes that lead to why so many people have trouble.  Unless the code is proprietary and you're charging, let people modify it away.
But seriously, if you're not charging I'm not sure why it's closed-source anyway-this community is good at that.  You can't have my super-secret 50 lines of really basic code that I'm never going to make money with.  I don't understand this mentality of locking everything down around here, I really don't.

My Blog
Twitter: @ajhicks1992

2014-10-22 17:35:30

Ah yes, all the people that encrypt their sounds, which more often then not were stolen from other places, but no, it's their sounds and no one else must have them.

Anyway, if you absolutely want to encrypt your dialogs, The dialog library can load the layout XML from memory. So you can use PB's built in XML functions to create your interface in code and, then load that into the dialog library and display the interface.

<Insert passage from "The Book Of Chrome" here>

2014-10-22 18:11:00

I'm not so much talking about sounds here.  I understand the case of sounds, sort of, though even there there's the creative commons attribution share-alike.  In the case of sounds, they may or probably aren't mine to share in the first place.
But code I write that's never going to build my commercial empire, why not?  Even Libaudioverse--which will be commercial--is open source.  So that's not even quite an excuse for some things.  We have many, many threads about how to program x or how the math for y works, and yet no one thinks about just using Github for their project and putting it up under BSD or MIT or something.  If it's a library and you want to sell, so long as you follow some basic rules, you can release a free version under the GPL-this means open source for open source projects, basically.
But in this case, yeah-you can't even touch the program logic, so why in the world does it matter?  And if you really, really care, so long as the language in question lets you use XML from a string, you can just encrypt the file anyway.

My Blog
Twitter: @ajhicks1992