Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by Steven T. Abell
Thu, 10 Sep 1992 19:48
Resizing menus
Author: Steven T. Abell
Date: Thu, 10 Sep 1992 19:48
Date: Thu, 10 Sep 1992 19:48
25 lines
1320 bytes
1320 bytes
I'm trying to change the title of MenuCells at run time, like this: [menuCell setTitleNoCopy:"NewTitle"]; where the new title is longer than the old title. Clearly something must be resized, such as in: [[menuCell controlView] sizeToFit]; Unfortunately, this doesn't do it. This resizes the Matrix containing the MenuCell, but doesn't resize its Menu, so the bezel gets overwritten and looks crappy. I tried following up the superview chain to find the Matrix's Menu, but I ran into this thing that called itself a FrameView (undocumented) which had no superview. Menu has a sizeToFit method that will do what I want (apparently), but I haven't found a reasonable way to invoke it, given only a pointer to a MenuCell in an arbitrary submenu. I must be missing something obvious. Can somebody help me out, or give me an appropriate RTFM pointer? Thanks, Steve abell@netcom.com
Re: Resizing menus
Author: Ray Spalding
Date: Thu, 10 Sep 1992 21:51
Date: Thu, 10 Sep 1992 21:51
18 lines
1062 bytes
1062 bytes
In article <fztn6md.abell@netcom.com> abell@netcom.com (Steven T. Abell) writes: >Menu has a sizeToFit method that will do what I want (apparently), but I >haven't found a reasonable way to invoke it, given only a pointer to a >MenuCell in an arbitrary submenu. Note that Menu inherits from Window, not View. Just do: [[[menuCell controlView] window] sizeToFit]; or: [[sender window] sizeToFit]; if "sender" is the Menu's matrix, as is normally the case. -- Ray Spalding, Office of Information Technology Georgia Institute of Technology, Atlanta Georgia, 30332-0715 Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads