Page 1 of 2

Window and menu

Posted: Mon Dec 12, 2005 1:38 am
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

Re: Window and menu

Posted: Mon Dec 12, 2005 5:21 pm
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.

Posted: Mon Dec 12, 2005 5:26 pm
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.

Posted: Mon Dec 12, 2005 5:52 pm
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

Posted: Mon Dec 12, 2005 6:28 pm
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

Posted: Mon Dec 12, 2005 6:42 pm
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

Posted: Mon Dec 12, 2005 7:07 pm
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 ?

Posted: Mon Dec 12, 2005 8:03 pm
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

Posted: Mon Dec 12, 2005 8:14 pm
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.

Posted: Mon Dec 12, 2005 8:29 pm
by SEO
Thanks, for your answers..

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

Thx,
SEO

Posted: Tue Dec 13, 2005 12:01 am
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?

Posted: Tue Dec 13, 2005 12:02 am
by Fred
they come from the Windows version, all done by Kale :).

Posted: Sat Dec 24, 2005 1:28 pm
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

Posted: Sat Dec 24, 2005 10:21 pm
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

Posted: Sun Dec 25, 2005 12:28 pm
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 ?