summaryrefslogtreecommitdiff
path: root/documentation/src/osissues.dox
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/src/osissues.dox')
-rw-r--r--documentation/src/osissues.dox52
1 files changed, 47 insertions, 5 deletions
diff --git a/documentation/src/osissues.dox b/documentation/src/osissues.dox
index e72398e..07fd508 100644
--- a/documentation/src/osissues.dox
+++ b/documentation/src/osissues.dox
@@ -479,6 +479,15 @@ In FLTK, all strings, including filenames, are UTF-8 encoded. The utility functi
fl_fopen() and fl_open() allow to open files potentially having non-ASCII names in a
cross-platform fashion, whereas the standard fopen()/open() functions fail to do so.
+\subsection osissues_wm_quit Responding to WM_QUIT
+
+FLTK will intercept WM_QUIT messages that are directed towards the
+thread that runs the main loop. These are converted to SIGTERM signals
+via \c raise(). This allows you to deal with outside termination
+requests with the same code on both Windows and UNIX systems.
+Other processes can send this message via \c PostThreadMessage() in
+order to request, rather than force your application to terminate.
+
\subsection osissues_win32_messages Handling Other WIN32 Messages
By default a single WNDCLASSEX called "FLTK" is
@@ -716,10 +725,6 @@ void fl_mac_set_about( Fl_Callback *cb, void *user_data, int shortcut)
Attaches the callback \c cb to the "About myprog" item of the system application menu.
\c cb will be called with NULL first argument and \c user_data second argument.
-Fl_Mac_App_Menu class
-\par
-The Fl_Mac_App_Menu class allows to localize the application menu.
-
Fl_Sys_Menu_Bar class
\par
@@ -727,8 +732,24 @@ The Fl_Sys_Menu_Bar class allows to build menu bars that, on Mac OS X, are
placed in the system menu bar (at top-left of display), and, on other platforms,
at a user-chosen location of a user-chosen window.
-\subsection osissues_quartz Drawing Things Using Quartz
+\subsection osissues_icon_osx Setting the icon of an application
+\li First, create a .icns file containing several copies of your icon of decreasing sizes.
+This can be done using the Preview application or the Icon Composer application
+available in "Graphics Tools for Xcode". To create a high resolution icon file,
+it is necessary to use the iconutil command-line utility.
+\li Put your .icns file in the Resources subdirectory of your application bundle.
+\li Add these two lines to the Info.plist file of your application bundle
+\verbatim
+<key>CFBundleIconFile</key>
+<string>foo.icns</string>
+\endverbatim
+replacing <tt>foo</tt> by your application name. If you use Xcode, just add your .icns file to your
+application target.
+
+
+
+\subsection osissues_quartz Drawing Things Using Quartz
All code inside Fl_Widget::draw()
is expected to call Quartz drawing functions. The Quartz coordinate system
is flipped to match
@@ -737,6 +758,27 @@ left corner of the enclosing Fl_Window. The global variable
\c fl_gc (of type \c CGContextRef) is the appropriate Quartz 2D drawing environment.
Include FL/x.H to declare the \c fl_gc variable.
+\subsection osissues_localize Internationalization
+All FLTK programs contain an application menu with, e.g., the About xxx, Hide xxx, and Quit xxx items.
+This menu can be internationalized/localized by any of two means.
+\li using the Fl_Mac_App_Menu class.
+\li using the standard Mac OS X localization procedure. Create a language-specific .lproj directory
+(e.g., <tt>German.lproj</tt>) in the Resources subdirectory of the application bundle.
+Create therein a <tt>Localizable.strings</tt> file that translates all menu items to this language.
+The German <tt>Localizable.strings</tt> file, for example, contains:
+\verbatim
+"About %@" = "Über %@";
+"Print Front Window"="Frontfenster drucken";
+"Services" = "Dienste";
+"Hide %@"="%@ ausblenden";
+"Hide Others"="Andere ausblenden";
+"Show All"="Alle einblenden";
+"Quit %@"="%@ beenden";
+\endverbatim
+Set <tt>"Print Front Window" = "";</tt> therein so the application menu doesn't show a "Print Front Window" item.
+To localize the application name itself, create a file <tt>InfoPlist.strings</tt> in each .lproj directory
+and put <tt>CFBundleName = "localized name";</tt> in each such file.
+
Fl_Double_Window
OS X double-buffers all windows automatically. On OS X,