Page 1 of 1
Mac version of my program, please test...
Posted: Thu May 03, 2007 7:05 pm
by DoubleDutch
I have done a Mac version of my program CutTheCosta - all thats missing is starting a browser with a predefined webpage.
Please can someone check it to make sure it works on other Macs, especially x86 based Macs.
http://www.cutthecosta.com/en/fly/download
Thanks!
-Anthony
Posted: Thu May 03, 2007 7:57 pm
by DoubleDutch
Just updated it to open Airline in the default browser... (Thanks freak

)
Posted: Fri May 04, 2007 8:58 am
by DoubleDutch
There have been quite a few Mac browsers visit the download link, anyone tried it with an x86 based mac? Does it work?
Posted: Fri May 04, 2007 10:48 am
by cologneskater
On a mac book pro it seems to work.
Starting browser windows by clicking the middle icon - ok
entering the shortcuts and searching - ok
searching without an input -> Messagebox - ok
rightscrolling the airplanelist - ok
clicking on the airplane icons starts browser with individual homepage - ok
quit the program with menu selection -> no reaction - not ok
maybe following thread could give you some ideas with menu handling on the mac:
http://www.purebasic.fr/english/viewtop ... c&start=15
Good work!
Posted: Fri May 04, 2007 11:47 am
by DoubleDutch
Thanks for checking it out.
Is the Mac Book Pro an x86 based Mac?
I will look into the menu issue. I don't normally use a Mac and its my first Mac program. Thanks v. much for the link.

Posted: Fri May 04, 2007 1:17 pm
by cologneskater
Yes, it's the first generation mac book pro with the intel core duo.
In the thread-link below look at the example code of MacWndTest.pb at the bottom of the page.
In addition, i found a post from Fred on Jul 11, 2005:
3 new constants have been added for menu: #PB_Menu_Quit, #PB_Menu_About and #PB_Menu_Preferences. These constants won't be defined on Windows/Linux but on OS X yes (which allow you to choose your own value on Linux/Windows). Why these constants are in ?
Because on OS X these 3 menu items are expected to be in the 'Application' menu which is a special one. So when PB encounter a menu item with a such constant it moves it automatically.
Usage: MenuItem(#PB_Menu_Quit, "Quit") etc. Shortcuts on such menus are ignored as OS X setup its own.
Posted: Fri May 04, 2007 4:02 pm
by DoubleDutch
Strange... #PB_Menu_Quit doesn't seem to be defined in Alpha 2.
Posted: Fri May 04, 2007 4:24 pm
by cologneskater
These constants are declared in PureBasic 3.94 for mac. Maybe they are not part of PB4 by now and it's a todo for the next alpha.
I made a check with the menu.pb program in the examples section. When i quit the program with the menu selection, the message requester told that menuitem -1 was selected. Replace the constant #PB_Menu_Quit with -1 for a test.
Posted: Fri May 04, 2007 8:18 pm
by DoubleDutch
Tried it and after clicking I got an invalid memory access (on the "Repeat" statement!)
I guess that constant isn't included for a reason!

Posted: Fri May 04, 2007 9:12 pm
by cologneskater
Strange, because a simple modification in the menu.pb example works.
Check the following:
1. Don't use a MenuItem()-Command for creating a quit-entry, because Mac OS X will always do that alone.
The only modification needed in your program is adding a check in the event loop for selection of the quit-entry in the mac application menu.
2. Insert a check for the quit-select in the application menu, for example
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
Select EventMenu()
Case -1
Quit = 1
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Posted: Fri May 04, 2007 9:49 pm
by DoubleDutch
That is almost an exact copy of what I have!
I'll double check in case I've done a typo somewhere.

Posted: Fri May 04, 2007 9:54 pm
by DoubleDutch
Just tried again, this time no problems (it was after a Mac reboot).
*** Edit ***
I've just uploaded a new version with the Mac menu quit working and a much larger database.
