I have two problems about objective c cocoa NSComboBox.
How can I set the scroll bar always visible, not just scroll the list.
Can I open the list by clicked the text, not just clicking the arrows.
I have two problems about objective c cocoa NSComboBox.
How can I set the scroll bar always visible, not just scroll the list.
Can I open the list by clicked the text, not just clicking the arrows.
a) Find the combo box window
- (NSWindow *)comboBoxPopUpWindow
{
NSWindow *child = nil;
for (child in [[self window] childWindows]) {
if ([[child className] isEqualToString:@"NSComboBoxWindow"]) {
break;
}
}
return child;
}
b) iterate the subviews of the windows content view
-(NSScrollView*)findScrollView:(NSWindow*)window
{
NSView *contentView = [window contentView];
for(NSView *view in [contentView subViews]){
if([[view className] isEqualToString:@"NSScrollView"]){
return scrollView;
}
}
}
c) Modify scrollview property