Getting a GUI To Work?

Mac OSX specific forum
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Getting a GUI To Work?

Post by Karbon »

I know about adding ".app" to the name when creating the executable. Unfortunately that still doesn't make the main window show for me (the same code compiles and runs perfectly on Windows). Nothing fancy at all - a simple OpenWindow() with 2 controls. Is there something special I need to be doing when running the program from the PB IDE to make the GUI show?

From debug messages I can see that the OpenWindow is getting called, it just doesn't seem to do anything.

I know I'm missing something simple here.. Help? :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Getting a GUI To Work?

Post by WilliamL »

:?: I'm confused, are you trying to run it from the IDE or as a stand-alone?

From the IDE use 'Compile/Run' (cmd R).

As an app, Compiler Options, Executable format set to MacOS. (everything else can be blank) Use 'Create Executable' (.app to the file name) Debug only works in IDE.

Try 'Window.pb' in the examples folder and use cmd+R and it should run in the IDE.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

Doh.. The X location of the window was set to 3000+ (I have 4 monitors on my other computer).. I guess it was showing, just off the screen.

Disregard ;-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Getting a GUI To Work?

Post by WilliamL »

I've done that with Gadgets with zero height! :D
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
devulder
New User
New User
Posts: 9
Joined: Fri Dec 19, 2008 5:52 pm

Re: Getting a GUI To Work?

Post by devulder »

Hi,

I'm working for a alternative GUI library (full COCOA) for purebasic,

I don't like the current systeme message (WaitWindowEvent,...)

I want try this :

Procedure my_window_moved(posx.l,posy.l)

; // window are moved

Endprocedure

global mywin.l

mywin = CreateWindow(...)

SetCallBack(mywin,WINDOW_MOVED,@my_window_moved())

What do you think ?

sorry for my very bad english !
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

I don't really have an opinion.. I wouldn't try to write a GUI-heavy software in PB for OSX. If you can make it "more native" I guess that would be a good thing!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Fred
Administrator
Administrator
Posts: 18161
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Getting a GUI To Work?

Post by Fred »

The IDE isn't GUI-heavy enough ? ;)
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

Sure it is, it just doesn't "look" like a Mac app is all. Maybe I'm doing something wrong but the GUI I get with PB on OSX looks completely different than what I get when using XCode.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Fred
Administrator
Administrator
Posts: 18161
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Getting a GUI To Work?

Post by Fred »

Could you post some screenshots ? It does look native here (actually it doesn't only look, it uses native calls).
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

Don't take that as a bug report. I've written a total of 1 application in XCode and when I think about it I used images for all the buttons and everything.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Getting a GUI To Work?

Post by freak »

Karbon wrote:Sure it is, it just doesn't "look" like a Mac app is all. Maybe I'm doing something wrong but the GUI I get with PB on OSX looks completely different than what I get when using XCode.
PB uses some settings that are not the default in Interface Builder/XCode mostly for crossplatform compatibility. That is probably the reason why it looks a bit different in some places. You can maybe achieve a similar look using Interface Builder as well if you tweak some settings, so this is not really "un-OSX-like", its just not the default. For example, we do not use the default "blue rounded" buttons for the ButtonGadget(), because these have a fixed height, while buttons on other OS have variable height. Using the different buttons is a compromise to have the PB commandset behave the same way as much as possible on all OS. After all, this is the goal of PB.

PB still looks way more OSX-like than many programs written in Java or using the X server for their GUI.
devulder wrote:I'm working for a alternative GUI library (full COCOA) for purebasic,
We will be porting the PB commandset over to Cocoa eventually simply because Carbon is not supported for 64bit applications, so you might want to rethink that. It will of course be with the same PB commands though (so still WaitWindowEvent()), not with different event handling.
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

The buttons are probably the single biggest thing I've noticed. Is there a way to use the blue rounded buttons with PB? (other than using an image button ;-)).
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Getting a GUI To Work?

Post by freak »

We could probably add a flag for that.
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: Getting a GUI To Work?

Post by Karbon »

That'd be great!!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply