Checked to see if the previous commit worked after removing the leftover Combobox selectIndex() code; it does. Removed the dummy code from the Windows and GTK+ backends as well.
This commit is contained in:
parent
4baa9397e6
commit
4045d50f94
|
@ -143,8 +143,6 @@ func (c *Combobox) make(window *sysData) (err error) {
|
|||
for _, s := range c.initItems {
|
||||
c.sysData.append(s)
|
||||
}
|
||||
// some platforms automatically select an item; undo that
|
||||
c.sysData.selectIndex(-1)
|
||||
c.created = true
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ id makeCombobox(BOOL editable)
|
|||
#define BIND bind:comboboxBinding toObject:ac withKeyPath:comboboxKeyPath options:nil
|
||||
// for NSPopUpButton, we need a little extra work to make it respect the NSArrayController's selection behavior properties
|
||||
// thanks to stevesliva (http://stackoverflow.com/questions/23715275/cocoa-how-do-i-suppress-nspopupbutton-automatic-selection-synchronization-nsar)
|
||||
// TODO where in the docs does it say that NSArrayController has a keyPath of selectionIndex? it's not in the Cocoa Bindings Reference
|
||||
// note: selectionIndex isn't listed in the Cocoa Bindings Reference for NSArrayController under exposed bindings, but is in the Cocoa Bindings Programming Topics under key-value observant properties, so we can still bind to it
|
||||
#define BINDSEL bind:@"selectedIndex" toObject:ac withKeyPath:@"selectionIndex" options:nil
|
||||
|
||||
if (!editable) {
|
||||
|
|
|
@ -103,7 +103,6 @@ extern void buttonSetTargetAction(id, id);
|
|||
extern void buttonSetText(id, id);
|
||||
extern id buttonText(id);
|
||||
extern id makeCheckbox(void);
|
||||
extern void comboboxSelectIndex(id, BOOL, intptr_t);
|
||||
extern id makeLineEdit(BOOL);
|
||||
extern void lineeditSetText(id, id);
|
||||
extern id lineeditText(id);
|
||||
|
|
|
@ -40,7 +40,6 @@ var _xSysData interface {
|
|||
setProgress(int)
|
||||
len() int
|
||||
setAreaSize(int, int)
|
||||
selectIndex(int)
|
||||
} = &sysData{} // this line will error if there's an inconsistency
|
||||
|
||||
// signal sends the event signal. This raise is done asynchronously to avoid deadlocking the UI task.
|
||||
|
|
|
@ -31,7 +31,6 @@ type classData struct {
|
|||
selTexts func(id C.id) []string
|
||||
delete func(id C.id, index int)
|
||||
len func(id C.id) int
|
||||
selectIndex func(id C.id, index int, alternate bool)
|
||||
}
|
||||
|
||||
func addControl(parentWindow C.id, control C.id) {
|
||||
|
@ -135,9 +134,6 @@ var classTypes = [nctypes]*classData{
|
|||
len: func(id C.id) int {
|
||||
return int(C.comboboxLen(id))
|
||||
},
|
||||
selectIndex: func(id C.id, index int, alternate bool) {
|
||||
C.comboboxSelectIndex(id, toBOOL(alternate), C.intptr_t(index))
|
||||
},
|
||||
},
|
||||
c_lineedit: &classData{
|
||||
make: func(parentWindow C.id, alternate bool, s *sysData) C.id {
|
||||
|
@ -406,13 +402,3 @@ func (s *sysData) setAreaSize(width int, height int) {
|
|||
}
|
||||
<-ret
|
||||
}
|
||||
|
||||
func (s *sysData) selectIndex(index int) {
|
||||
ret := make(chan struct{})
|
||||
defer close(ret)
|
||||
uitask <- func() {
|
||||
classTypes[s.ctype].selectIndex(s.id, index, s.alternate)
|
||||
ret <- struct{}{}
|
||||
}
|
||||
<-ret
|
||||
}
|
||||
|
|
|
@ -139,11 +139,6 @@ id makeCheckbox(void)
|
|||
return checkbox;
|
||||
}
|
||||
|
||||
void comboboxSelectIndex(id combobox, BOOL editable, intptr_t index)
|
||||
{
|
||||
// TODO remove
|
||||
}
|
||||
|
||||
id makeLineEdit(BOOL password)
|
||||
{
|
||||
if (password)
|
||||
|
|
|
@ -362,7 +362,3 @@ func (s *sysData) setAreaSize(width int, height int) {
|
|||
}
|
||||
<-ret
|
||||
}
|
||||
|
||||
func (s *sysData) selectIndex(index int) {
|
||||
// TODO not yet implemented on Unix (added for Mac only right now)
|
||||
}
|
||||
|
|
|
@ -643,7 +643,3 @@ func (s *sysData) setAreaSize(width int, height int) {
|
|||
}
|
||||
<-ret
|
||||
}
|
||||
|
||||
func (s *sysData) selectIndex(index int) {
|
||||
// TODO not yet implemented on Windows (added for Mac only right now)
|
||||
}
|
||||
|
|
2
todo.md
2
todo.md
|
@ -1,8 +1,6 @@
|
|||
important things:
|
||||
- NSComboBox scans the entered text to see if it matches one of the items and returns the index of that item if it does; find out how to suppress this so that it returns -1 unless the item was chosen from the list (like the other platforms)
|
||||
- asked: http://stackoverflow.com/questions/23046414/cocoa-how-do-i-get-nscombobox-indexofselecteditem-to-return-1-if-the-user-m
|
||||
- Mac OS X forces items selected when changing the NSPopUpButton (noneditable Combobox) lists; figure out how to inhibit this
|
||||
- asked: http://stackoverflow.com/questions/23715275/cocoa-how-do-i-suppress-nspopupbutton-automatic-selection-synchronization-nsar
|
||||
|
||||
super ultra important things:
|
||||
- 10.6 also spits a bunch of NSNoAutoreleasePool() debug log messages even though I thoguht I had everything in an NSAutoreleasePool...
|
||||
|
|
Loading…
Reference in New Issue