 |
 |
Forcing an NSComboBox to show its list?
|
 |
|
 |
|
Forum Regular
Join Date: Apr 1999
Location: London, UK
Status:
Offline
|
|
Hi,
Does anyone know if it's possible to force an NSComboBox to show its list programmatically, i.e. not waiting for the user to click the arrow button or press the down arrow key? I basically want it to behave like the URL field in web browsers.
I cannot find any method that looks like it will to that. Will I need to use a custom control for this?
Thanks
Amar
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
I've tried to do this before as well. There seems to be no public method. I had a look at the class-dumped AppKit headers and found private methods that could be called but for me that's rather unsatisfactory. Take a look at
http://www.collaboration-world.com/c...viewcvs-markup
which may do what you want.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Apr 1999
Location: London, UK
Status:
Offline
|
|
Brilliant, thanks! That works rather well.
One thing, though: Is it possible to make the drop-down list follow the window continuously as it's being moved around?
I've tried updating its position from within the windowDidMove method, but that only seems to get called after the mouse rests.
Thanks
Amar
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
It'd probably be easier and safer to just implement your own drop-down: that's the way our URL-field and form autocomplete works in OmniWeb, and it looks like Safari's work that way as well.
Just create a borderless window with an NSTableView in it, and position/show it when the user starts typing. To make it follow the parent window around, use the new NSWindow parent/child APIs introduced in 10.3.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by asagoo:
One thing, though: Is it possible to make the drop-down list follow the window continuously as it's being moved around?
I've tried updating its position from within the windowDidMove method, but that only seems to get called after the mouse rests.
-[NSWindow addChildWindow:ordered:]
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |