Instead of creating 4 separate posts, I have combined my questions into this single post.
Hopefully, people can answer each question as and when they get the chance.
Is it possible to put code into a button’s action event, which when clicked, will add my app to the list of autostart upon login?
If, so - could someone please point me in the right direction.
Could someone also point me to where I get information regarding putting an icon into the OS X menubar (I believe it is called a menubarlet)?
Regarding MacOSLib - is it simply a list of declares and code which provides features not directly available in Xojo - or - does it also contain controls / classes etc? Also, if I use MacOSLib in my project - will it cause my compiled app to create a myApp.Libs folder? At the moment, my compiled app does not create a libs folder as it is not required.
I have 4 windows (all set to use MenuBar1). However, Only my main window and one other window (movable modal, which is initiated from the menubar itself) actually display the menubar. The other 2 windows (also movable modal) cause the menubar to disappear when they open? Any ideas what could be the cause?
Thank you all in advance for any help you can provide.
#3) MacOsLib will only compile (and thus increase the size of your app) for any portions of it that you actually use. I just wish the level of documentation was adequate to help understand all the code there.
#4) If you have a window that causes the menubar to disappear, then you did not attach the menubar to it. Click on the window. Look at the inspector…very bottom “MENUS”… make sure it does NOT say “NONE”
and 2) I believe there is such code in MacOSLib, but don’t know for sure.
It’s a set of classes and functions to essentially “port” the the OS X toolbox into Xojo code. Instead of using declares to implement an NSDictionary, for example, you’d dim nsd as new NSDictionary and all the necessary declares are handled for you. You’d then use it like you would any other Xojo class.
Among the things that are implemented are controls like the search field.
Since MacOSLib is just a set of modules and classes, there is no Lib folder created.
Are you setting MenuBarVisible to False somewhere?
#2) I think you mean a NSStatusItem. An example is in Examples -> Cocoa -> NSStatusItem if you run the project. If you want it to remain in the StatusBar after the user quits your application it will have to be a separate application.
Regarding the Menubar question - ALL of the windows have MenuBar1 set in the inspector, but only 2 of the four actually display it?? And I am not using MenuBarVisible=false anywhere. That is what I find so complexing
That says MENUBAR1… the default is “MainMenuBar”
So did you create a 2nd menubar? are you sure it has items on it? (just grasping at straw here)
I assume you are seeing “SOMETHING”… if I delete items from a test menubar… I still see “MyApplication”
I deleted the original default MenuBar when I first started the project. I then later created MenuBar1, which is now the only MenuBar in my project, and all windows are set to display it. Yes - it has items in it because the other window which displays the MenuBar correctly can also be called from within MenuBar1 itself.
My main window displays MenuBar1.
From within MenuBar 1 I can open Window2 - which correctly displays the same MenuBar1.
Windows 3 and 4 are also set to display MenuBar1, but when they open - the MenuBar1 disappears???
There is no other MenuBar code in my entire project?
I have even duplicated MenuBar1 and renamed it MenuBar2, and then set the two troublesome windows to use that MenuBar - TO NO AVAIL - the same thing happens - no MenuBar is displayed.
I already own all of your plugins so I will look into it.
I just experimented quickly. If you delete the MainMenuBar and later insert a new menubar, even if you rename it to MainMenuBar, it fails indeed to show the menu.
The solution I found is to copy MainMenuBar from a new project and paste it back into the crippled project. Then it shows in all the app. You will have to recreate the items but it will work. Lessons is : do not delete the default MainMenuBar (Why did you in the first place ? ? ?)
I do not know if this is the same problem for you but I had to solve a strange disappearance of a menubar recently. After a while I realised that the menubar was absent for one of the Application’s window. I tracked back the bug in older version of the application to see when it started to show-up and I found that it was a kind of corruption of a Menubar reference number. I think it actually happened when I was trying to create a Menulet.
To check if it is the same problem: you should save your application in version control format. Then open (for example using Texwrangler) the file corresponding to the windows that lost the Menubar.
You should see a parameter “Menubar = 0”. In my case, the problem was that it was something like a random number (something like “MenuBar = 2345467”). I just put it back to “Menubar = 0” and it solved the problem
Hope it will help.