DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2666
Version: 1.3-feature
The current OS X about dialog will show you "GUI with FLTK %d.%d" as the
copyright string. It would be nice if the application could put its actual
copyright notice there, and also get the default behaviour of fetching the
information from the bundle. Attached patch adds those two features.
Link: http://www.fltk.org/str.php?L2666
Version: 1.3-feature
diff -up fltk-1.3.x-r8772/FL/mac.H.orig fltk-1.3.x-r8772/FL/mac.H
--- fltk-1.3.x-r8772/FL/mac.H.orig 2011-06-16 12:48:26.796007948 +0200
+++ fltk-1.3.x-r8772/FL/mac.H 2011-06-16 12:57:15.008581876 +0200
@@ -213,6 +213,9 @@ class Fl_Mac_App_Menu {
public:
/** Localizable text for the "About xxx" application menu item */
static const char *about;
+ /** Copyright notice for the default about dialog. Will use the information
+ from the bundle if set to an empty string. */
+ static const char *copyright;
/** Localizable text for the "Print Front Window" application menu item.
This menu item won't be displayed if Fl_Mac_App_Menu::print
is set to an empty string.
diff -up fltk-1.3.x-r8772/src/Fl_cocoa.mm.orig fltk-1.3.x-r8772/src/Fl_cocoa.mm
--- fltk-1.3.x-r8772/src/Fl_cocoa.mm.orig 2011-06-16 12:32:39.262088892
+0200
+++ fltk-1.3.x-r8772/src/Fl_cocoa.mm 2011-06-16 13:00:42.680073109 +0200
@@ -3076,12 +3076,25 @@ int Fl_X::set_cursor(const Fl_RGB_Image
@implementation FLaboutItemTarget
- (void)showPanel
{
- NSDictionary *options;
- options = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithFormat:@" GUI with FLTK
%d.%d", FL_MAJOR_VERSION,
- FL_MINOR_VERSION ], @"Copyright",
- nil];
- [NSApp orderFrontStandardAboutPanelWithOptions:options];
+ if ((Fl_Mac_App_Menu::copyright == NULL) ||
+ (strlen(Fl_Mac_App_Menu::copyright) > 0)) {
+ NSString *copyright;
+
+ if (Fl_Mac_App_Menu::copyright == NULL)
+ copyright = [NSString stringWithFormat:@" GUI with FLTK %d.%d",
+ FL_MAJOR_VERSION, FL_MINOR_VERSION ];
+ else
+ copyright = [NSString stringWithUTF8String:Fl_Mac_App_Menu::copyright];
+
+ NSDictionary *options;
+ options = [NSDictionary dictionaryWithObjectsAndKeys:
+ copyright, @"Copyright",
+ nil];
+
+ [NSApp orderFrontStandardAboutPanelWithOptions:options];
+ } else {
+ [NSApp orderFrontStandardAboutPanelWithOptions:nil];
+ }
}
//#include <FL/Fl_PostScript.H>
- (void)printPanel
diff -up fltk-1.3.x-r8772/src/Fl.cxx.orig fltk-1.3.x-r8772/src/Fl.cxx
--- fltk-1.3.x-r8772/src/Fl.cxx.orig 2011-06-16 12:52:30.695898120 +0200
+++ fltk-1.3.x-r8772/src/Fl.cxx 2011-06-16 12:55:43.854026603 +0200
@@ -86,6 +86,7 @@ extern void fl_update_focus(void);
//
#if defined(__APPLE__) || defined(FL_DOXYGEN)
const char *Fl_Mac_App_Menu::about = "About ";
+const char *Fl_Mac_App_Menu::copyright = NULL;
const char *Fl_Mac_App_Menu::print = "Print Front Window";
const char *Fl_Mac_App_Menu::services = "Services";
const char *Fl_Mac_App_Menu::hide = "Hide ";
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev