Derived from: public BWindow
Declared in: ImageAboutWindow.h
Library: none
Creates an about window containing a logo sidebar image and text indicating the application name, version (pulled from the short version string in the resources), and body text. The logo sidebar image should have dark grey (R184,G184,B184) on the left hand side, and light grey (R216,G216,B216) on the right hand side of the center of the logo image.
Note that it is bad thread-safe programming practice to keep a pointer to a BWindow. This is because if the user closes the window, you'll be left with a bad pointer. Even if your window destructor sends a message announcing its death, between the window closing and the application (or other thread) receiving the death message, a race condition would exist. Therefore, it is best to just keep a BMessenger pointing to any BWindow. In keeping with this, if you already have an about window open and the user selects the About (your app)... menu item and you want to bring the existing about window to front, DO NOT call Activate() from another thread. Instead, send it a BMessage with what = c_about_window_to_front. You can detect the death of an ImageAboutWindow by responding to a BMessage with what = c_about_window_closed in your application's MessageReceived() method. This message will be posted to be_app when the ImageAboutWindow is destroyed.
ImageAboutWindow(const char* window_title, const char* app_title, const char* icon_resource_name, float icon_sidebar_offset, const char* body_text)
window_title specifies the window title (in the above image, "About Subcue Librarian". app_title specifies the application title specified in bold on the right top of the window body. icon_resource_name specifies the name of a 'bits' resource holding a logo image file for loading by BTranslationUtils. The image should have dark grey (R184,G184,B184) on the left hand side, and light grey (R216,G216,B216) on the right hand side of the center of the logo image. The icon_sidebar_offset is the offset into this image of the first column of the lighter color. The short version string from the application version resource is loaded and displayed in the about window.
~ImageAboutWindow()
Destroys the window and posts a BMessage with what = c_about_window_closed to be_app.
const uint32 c_about_window_to_front = 'AbTF';
const uint32 c_about_window_closed = 'AbCl';
An ImageAboutWindow will respond to a BMessage with what = c_about_window_to_front posted to it by activating itself. Upon its destruction, an ImageAboutWindow will post a BMessage with what = c_about_window_closed to be_app.
By Brian Tietz
Copyright 2000
Bug reports (including documentation errors) and feature requests can be sent to briant@timelinevista.com.