Page 1 of 1
Getting a GUI To Work?
Posted: Sat Jun 05, 2010 3:36 pm
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?

Re: Getting a GUI To Work?
Posted: Sat Jun 05, 2010 5:43 pm
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.
Re: Getting a GUI To Work?
Posted: Sat Jun 05, 2010 6:02 pm
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

Re: Getting a GUI To Work?
Posted: Sat Jun 05, 2010 6:06 pm
by WilliamL
I've done that with Gadgets with zero height!

Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 8:59 pm
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 !
Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 9:08 pm
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!
Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 9:34 pm
by Fred
The IDE isn't GUI-heavy enough ?

Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 9:36 pm
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.
Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 9:37 pm
by Fred
Could you post some screenshots ? It does look native here (actually it doesn't only look, it uses native calls).
Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 10:01 pm
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.
Re: Getting a GUI To Work?
Posted: Wed Jun 09, 2010 11:13 pm
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.
Re: Getting a GUI To Work?
Posted: Thu Jun 10, 2010 12:10 am
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

).
Re: Getting a GUI To Work?
Posted: Fri Jun 11, 2010 12:09 am
by freak
We could probably add a flag for that.
Re: Getting a GUI To Work?
Posted: Fri Jun 11, 2010 12:11 am
by Karbon
That'd be great!!