Window and menu

Mac OSX specific forum
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Window and menu

Post by SEO »

Hi,

I have now spent some hours on PB for Mac, testing to create an menu.

Q:
Can't i create an menu, if i not have created an Window?

I try to find an workaround for this, and 'hide' the window, but then the menu not working.

I should need an 'WaitForMenuEvent' .....

The Window close widget on OS X should NOT Quit the application, only the close the window.

Any ideas about this?

Thx,
SEO

---------------------------------------------
http://developer.apple.com/documentatio ... index.html
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: Window and menu

Post by michel51 »

Hi SEO
Can't i create an menu, if i not have created an Window?
I think, you cannot! Creating a menu requires a WindowID, so you have to have an open window (see examples in HELP)
I should need an 'WaitForMenuEvent' .....
'WaitWindowEvent()' or 'WindowEvent' . Where you find 'WaitForMenuEvent'. Or am I blind...?
The Window close widget on OS X should NOT Quit the application, only the close the window.
Correct! But an 'End'-Command at the end of the Application will Quit.

Hope, I could help.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The window 'Close' button should just fire a #PB_Event_CloseWindow event and you can choose to end or not the application by handle it or not.

About the 'menu without window', it's not possible in PB for now, as every menu needs its own window (it's a MacOS only feature to be able to display a menu without active window). I will see what can be done tough, may be allowing a default menu.
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Thanks Fred and michael51...

Menu: I understand and also why...

WaitForMenuEvent(): No you are NOT blind, but I wrote 'I NEED' ...

But my work to test, is still going on.... PB is very interesting, it creates an nice Mac bundle and the speed look fast. I understand that this version is new and there are a lot of 'features' that is missing in Mac version. (Metal windows, drawer windows and so on)...

And I must say the Toolbar is NOT Mac, but very nice!!
I know that PB is an 'Crossplattform' developing Tool and I can accept some things that is not 100% Mac, I have seen worse (Java apps)!

----------
TIP:
Select EventMenuID() ; To see which menu has been selected
Case -1 : Quit = 1 ;// Quit from Doc
EndSelect ;// #PB_EventMenu
-----------

I found that Quit from Doc generate -1, so this shuld be using....


Thanks to you all,
Regards

SEO
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Post by michel51 »

Hi SEO,
WaitForMenuEvent(): No you are NOT blind, but I wrote 'I NEED' ... :oops:
Do you use only Mac or Windows too? Tiger?

And I'm testing too... and my work with PB is "Trial and Error" :lol:
... the Toolbar is NOT Mac, but very nice!!
I tried to generate a toolbar, but only the separator is shown. Can you post a small code-snippet, so I can see how it works on your mashine? I've tried the example from help. I don't know, why the buttons are not shown.

regards
michel51
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Hi michael51!

When I download PB for Mac and starting, PB chrashed every minute, then I download an new copy and 'Install it' .. and after that I use the 'Disk utility' and 'Repair the Disk Permissions' ... and after that it works (OS X 10.4.3)...

The Toolbar: I am still in 'Hello World!' , but I mean the Toolbar in the PB Editor ...

You could contact me: svenerik@xhtmlsoft.com (have you Skype?)

Regards,
SEO
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

About the toolbar, you have to use ToolbarImageButton() as standard buttons aren't implemented on OS X (as the OS doesn't have one, i asked my brother to do some, but i only got 4 :P).

BTW, why do you say than the toolbar isn't 'Mac' ? It just use plain API call, to create the toolbar, so i believe it's ok ?
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Mac Toolbar

I have not written any Toolbar by my self, yet.
But I have seen the Toolbar in the PB Editor.

1 - The PB Toolbar is about 24px in height
2 - Mac is about 56px in height (icons is 32x32px) + text

http://www.okraft.nu/seedit/toolbars/osx104toolbar.jpg
http://www.okraft.nu/seedit/toolbars/seedittoolbar.jpg
http://www.okraft.nu/seedit/toolbars/osx103toolbar.jpg

But in this time this is an 'minor problem' ....

Regards,
SEO
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

While you can't put text on toolbar in PB, you can use 32x32 png if you want to have a bigger toolbar (48x48 should work as well). PNG AlphaChannel is also handled, so you should be able to do good looking toolbars.
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Thanks, for your answers..

I should try it later, it is so much to check for an 'newbie' ...

Thx,
SEO
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Post by michel51 »

@Fred:
That's a good idea. I will try.

But what about the icons in the toolbar of the PB-editor? Where do they come from?
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

they come from the Windows version, all done by Kale :).
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

I have tested and written an simple Test Application using an MainWindow, AboutBox and an ToolPalette ...

The problem I have is, I must create an menu (Main menu) to every window. So you could open one window and after that open yet another..

But when I close the 'second' window and go back to my Main window, the menu not working, I can't open the second window again... But the Toolbar that I have in the 'Main Window' works...

I see in the PureBasic IDE, there is also some strange behavior, if you open an second window you cant open an another window... Open the 'About Box' then you can't open an another winodw....

Is there some that using Mac, have an idea how to fix this... It looks there is now way to 'activate the Mainmenu (Created in the Main Window), when i have closed the second window ...


Any Ideas??
//SEO
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

I have put an example of this problem on my server ....
http://www.xhtmlsoft.com/pb/downloads/myExample2.zip

There are also an ReadMe file ...
Thanks for any ideas how to fix this problem...

Regards,
SEO
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Sounds like a bug, i will take a closer look to it. BTW, usually on Mac OS X the applications only have one menu bar ? Or can the menu change depending of the active window ?
Post Reply