From 03f544c401fed2f2cb257bd2dd1e9bee64c812f0 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Mon, 7 Dec 1998 03:08:07 +0000 Subject: [PATCH] Implemented SetTitle using nsString::ToCString. Will need to revisit when UNICODE window titles are supported. git-svn-id: svn://10.0.0.236/trunk@15897 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacWindow.cpp | 15 +++++++++++++++ mozilla/widget/src/mac/nsMacWindow.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/mozilla/widget/src/mac/nsMacWindow.cpp b/mozilla/widget/src/mac/nsMacWindow.cpp index 9edd6612079..ab461586c6b 100644 --- a/mozilla/widget/src/mac/nsMacWindow.cpp +++ b/mozilla/widget/src/mac/nsMacWindow.cpp @@ -232,6 +232,21 @@ NS_IMETHODIMP nsMacWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRep return NS_OK; } +//------------------------------------------------------------------------- +// +// Set this window's title +// +//------------------------------------------------------------------------- +NS_IMETHODIMP nsMacWindow::SetTitle(const nsString& aTitle) +{ + Str255 title; + title[0] = aTitle.Length(); + aTitle.ToCString((char*)title + 1, sizeof(title) - 1); + ::SetWTitle(mWindowPtr, title); + return NS_OK; +} + + //------------------------------------------------------------------------- // // Handle OS events diff --git a/mozilla/widget/src/mac/nsMacWindow.h b/mozilla/widget/src/mac/nsMacWindow.h index 7a7b59a18b5..b3cba533efe 100644 --- a/mozilla/widget/src/mac/nsMacWindow.h +++ b/mozilla/widget/src/mac/nsMacWindow.h @@ -77,6 +77,8 @@ public: NS_IMETHOD Move(PRUint32 aX, PRUint32 aY); NS_IMETHOD Resize(PRUint32 aWidth,PRUint32 aHeight, PRBool aRepaint); + NS_IMETHOD SetTitle(const nsString& aTitle); + virtual PRBool HandleOSEvent( EventRecord& aOSEvent);