aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Robert2009-09-27 15:49:08 +0000
committerAdrian Robert2009-09-27 15:49:08 +0000
commit3988c7d603276b0f49d905c39e8afa9624db3163 (patch)
tree2cf104b5f5742228dd7894926e3ef4a06f73a6b7 /src
parentf27a64a912771b21e448f903c0b3ee857c437398 (diff)
downloademacs-3988c7d603276b0f49d905c39e8afa9624db3163.tar.gz
emacs-3988c7d603276b0f49d905c39e8afa9624db3163.zip
(ns_update_menubar): Use ns_app_name. Sync with xmenu.c. (EmacsMenu-clear:, ns_popup_dialog): Use ns_app_name.
Diffstat (limited to 'src')
-rw-r--r--src/nsmenu.m24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 749a1d0fe76..f6603ce8c37 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -156,7 +156,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
156 156
157 if (menu == nil) 157 if (menu == nil)
158 { 158 {
159 menu = [[EmacsMenu alloc] initWithTitle: @"Emacs"]; 159 menu = [[EmacsMenu alloc] initWithTitle: ns_app_name];
160 needsSet = YES; 160 needsSet = YES;
161 } 161 }
162 else 162 else
@@ -171,16 +171,6 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
171 t = -(1000*tb.time+tb.millitm); 171 t = -(1000*tb.time+tb.millitm);
172#endif 172#endif
173 173
174 /* widget_value is a straightforward object translation of emacs's
175 Byzantine lisp menu structures */
176 wv = xmalloc_widget_value ();
177 wv->name = "Emacs";
178 wv->value = 0;
179 wv->enabled = 1;
180 wv->button_type = BUTTON_TYPE_NONE;
181 wv->help = Qnil;
182 first_wv = wv;
183
184#ifdef NS_IMPL_GNUSTEP 174#ifdef NS_IMPL_GNUSTEP
185 deep_p = 1; /* until GNUstep NSMenu implements the Panther delegation model */ 175 deep_p = 1; /* until GNUstep NSMenu implements the Panther delegation model */
186#endif 176#endif
@@ -399,6 +389,14 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
399 int n; 389 int n;
400 Lisp_Object string; 390 Lisp_Object string;
401 391
392 wv = xmalloc_widget_value ();
393 wv->name = "menubar";
394 wv->value = 0;
395 wv->enabled = 1;
396 wv->button_type = BUTTON_TYPE_NONE;
397 wv->help = Qnil;
398 first_wv = wv;
399
402 /* Make widget-value tree w/ just the top level menu bar strings */ 400 /* Make widget-value tree w/ just the top level menu bar strings */
403 items = FRAME_MENU_BAR_ITEMS (f); 401 items = FRAME_MENU_BAR_ITEMS (f);
404 if (NILP (items)) 402 if (NILP (items))
@@ -677,7 +675,7 @@ name_is_separator (name)
677 NSMenuItem *item = [self itemAtIndex: n]; 675 NSMenuItem *item = [self itemAtIndex: n];
678 NSString *title = [item title]; 676 NSString *title = [item title];
679 if (([title length] == 0 /* OSX 10.5 */ 677 if (([title length] == 0 /* OSX 10.5 */
680 || [@"Emacs" isEqualToString: title] /* from 10.6 on */ 678 || [ns_app_name isEqualToString: title] /* from 10.6 on */
681 || [@"Apple" isEqualToString: title]) /* older */ 679 || [@"Apple" isEqualToString: title]) /* older */
682 && ![item isSeparatorItem]) 680 && ![item isSeparatorItem])
683 continue; 681 continue;
@@ -1663,7 +1661,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
1663 area.size.height= TEXTHEIGHT; 1661 area.size.height= TEXTHEIGHT;
1664 command = [[[NSTextField alloc] initWithFrame: area] autorelease]; 1662 command = [[[NSTextField alloc] initWithFrame: area] autorelease];
1665 [[self contentView] addSubview: command]; 1663 [[self contentView] addSubview: command];
1666 [command setStringValue: @"Emacs"]; 1664 [command setStringValue: ns_app_name];
1667 [command setDrawsBackground: NO]; 1665 [command setDrawsBackground: NO];
1668 [command setBezeled: NO]; 1666 [command setBezeled: NO];
1669 [command setSelectable: NO]; 1667 [command setSelectable: NO];