Menu bar button panels in Cocoa? - objective-c

When I click on buttons in the menu bar (such as "About Program") when the program is running a new window pops up displaying information. How do I edit the windows associated with the buttons?
In Interface builder I manage to load "Main Menu" which allows me to customize the menu bar, but it doesn't allow me to work with the windows associated with the buttons. How would I edit these windows?
Mac OSX Snow Leopard, Xcode 3.2.6
EDIT: I am not specifically asking for steps for the "About Panel". I am looking for a general procedure for editing panels associated with buttons in the menu bar. In addition to the "About" panel I would also want to work with panels such as the "Help" panel. The "About" panel was just an example.

The standard About panel isn't in your nib; it's generated within the framework.
You can change the text of the panel by writing a Credits.rtf or Credits.html file and including that in your app bundle. (You may already have Credits.rtf supplied by the project template. If so, you should just edit that.)
If you want to make more radical changes, you'll need to create your own panel and change your About menu item to show it instead.

As far as a general procedure...no, there's no single procedure that would let you customize any standard panel in the same way. They all have their own mechanisms (e.g. some can display more panes when plug-in components are installed; some provide APIs to hide or show certain parts; some, like the About box, use bundle filename conventions to decide what to do).
For the Help panel specifically...you can't change anything about it except the web page (i.e. the help content). The toolbar, etc. is all handled by Apple. I suggest looking at this documentation for more, which also links to other important documents:
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/OnlineHelp/Concepts/ComprehenHelp.html%23//apple_ref/doc/uid/20000017-BBCCFHAC

Related

How to create a background only program that can show a window with text fields

I want to create a program that consists of just a menu in the status bar (no dock icon or menu bar) that, when the user clicks on menu items, opens a window that allows the user to enter text (NSTextField and NSTextView).
I can make the program background only by setting the "Application is background only" property to YES in my Info.plist file, however, when I do this and display a window, firstly the window always appears behind other windows, and secondly I can't type any text into it (text goes to whatever last had focus - usually a source file in Xcode!)
This is definitely not something as simple as the fields are not enabled. Simply changing the "background only" property to NO fixes the issue, but then I get a dock icon and menu bar which I don't want.
Is what I'm trying to do possible or is there something about the background only mode that means my application can never receive text?
If it is possible what do I need to do to fix this?
From the documentation for LSBackgroundOnly:
You can use this key to create faceless background apps. You should also use this key if your app uses higher-level frameworks that connect to the window server, but are not intended to be visible to users.
So when they say “background only”, they mean background only.
The key you want is LSUIElement. Xcode describes this as “Application is agent (UIElement)”.
I personally can't stand Xcode's default behavior of showing me descriptions of some of the keys' meanings. I recommend turning on “Show Raw Keys/Values”; then, Xcode will show you the real keys being used in the dictionary.

Change Icon on Task Bar for VB.net

I have a program in vb.net which is ready to be published.
Its a small detail, but I'd like to change the icon on both the published app shortcut on my desktop, but more importantly on my taskbar (like where the chrome circle shows up).
Is there any way to accomplish this?
To change the main icon for your application, go to the "Application" tab under the project property page, and change the "Icon:" combo box.

How do I add buttons to Aero Peek in VB6?

I'm working on a program that can play songs off an iPod. I want to be able to put functional Back, Play/Pause and Next buttons on its Aero Peek thumbnail like this:
For those who can't see it: http://i45.tinypic.com/1yua0m.png
How would I do this in VB6?
EDIT: Can I also create a jump list for my app? For this app, I only need taskbar jump lists. For others, I'll need taskbar and start menu jump lists so posting code to achieve both would be appreciated.
EDIT 2: I have uploaded a sample of how to use the ITaskBarList3 interface to add buttons to the window preview (and handle their click events), add an icon overlay, clip the window preview and add a progress bar to the program's taskbutton. Download it here.
Look at the Taskbar Thumbnail Toolbar feature of Windows Explorer. This does use a COM interface so I don't know how practical it is to use for VB but I beliver the IDLs are available if you look.
You can also find a C# example and the UI guidelines on MSDN.
The Jumplist information is also covered on the same pages.

Document-based-like application + updating fields/menus/etc when switching document?

I have an application with multiple documents opened at once (as different tabs), but not implemented the Cocoa way, with NSDocument etc
So, let's say, that application is a text editor : e.g. an NSTextView in each document/tab and a menu (in the MainMenu) with options (on/off) related to that particular document.
Scenarios :
The user clicks a menu item (option) and the option is applied to the
current tab
Now, the user switches tab and the options (of the menu) should be update according to current document's settings
How should I go about that in the most Cocoa-friendly way?
(I certainly CAN do it; though I'm interested in what could be a more efficient way (and my definitely isn't))
You can implement validateUserInterfaceItem: on NSDocument. Menu and toolbar items call it to check if they should be enabled or not. Read about Implementing Validation in general and Enabling Menu Items specifically.

Squeak System Browser Questions

I am using (a school modified version of) the "Squeak By Example" (SBE) image for a OOP/OOD class. However, my System Browser is missing a few features that appear in SBE. I assume there are some configuration options that can get them back for me, but I can't find them yet.
My questions are:
1) How do I get the buttons back? In the bottom pane there should be a bunch of button (browse, senders, implementors, versions, ..., source). My buttons are missing.
2) How do I get the small workspace area above the buttons to appear? There is supposed to be an area that I can type in, below the top panes, and above the buttons, but it doesn't appear.
Thanks in advance!
Robert
Edit - I did fool around in the Preferences Browser and tried a lot of settings. I managed to make the buttons come back and then later got that small (unknown name) workspace pane back, but I have no idea how. I have tried to systematically turn stuff off again to find out what setting(s) controlled what, but I was unable to determine what controlled either problem. So even though I have it working, I would like some squeak/smalltalk knowledgeable person to let me know how to control these as it might help me learn...
"In the bottom pane there should be a bunch of button (browse, senders, implementors, versions, ..., source). " -- switch on the optionalButtons preference in the preferences browser.
The "area that I can type in, below the top panes, and above the buttons, but it doesn't appear" sounds like the annotation pane - this gives you summary information about the method you're currently viewing, and it's controlled by the annotationPanes preference. Alternatively you may be referring to the Mercury Panel which is used for fast navigation to other classes and methods; this is (of course :-) controlled by the mercuryPanel preference.
If you've been messing around, you may also find that you now have an incorrect system browser selected. Squeak has a choice of browsers which can act as the System Browser. You can choose between them by clicking the menu button on the System Browser and selecting "Choose new default Browser". Open a new browser window to see what effect this has had.
You may also want to try a Pharo image which has everything configured the way you want by default.
Do you have access to the Preferences Browser? It should be in the main system menu. You can alter all sorts of things via this browser, including which buttons appear in teh system browser?