From 9e1a7079c38496eb4e291769bcc269e1bebd19e9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 15 May 2011 09:42:36 +0000 Subject: Mac OS: implemented the effect of the 2nd arg of Fl_Window::label(label, iconlabel) that sets the window name when it is iconized (or minimized). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8664 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8b46c27b2..3715657ce 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2209,13 +2209,21 @@ const char *fl_filename_name( const char *name ) /* - * set the window title bar - * \todo make the titlebar icon work! + * set the window title bar name */ -void Fl_Window::label(const char *name,const char */*iname*/) { +void Fl_Window::label(const char *name, const char *mininame) { Fl_Widget::label(name); + iconlabel_ = mininame; if (shown() || i) { - q_set_window_title((NSWindow*)i->xid, name); + NSWindow* nsw = (NSWindow*)i->xid; + q_set_window_title(nsw, name); + if (mininame && strlen(mininame)) { + CFStringRef minititle = CFStringCreateWithCString(NULL, mininame, kCFStringEncodingUTF8); + if (minititle) { + [nsw setMiniwindowTitle:(NSString*)minititle]; + CFRelease(minititle); + } + } } } -- cgit v1.2.3