Fixed selection grabbing and also append/insert/removal crashes: all were selector name typos. Also some TODOs Now to make this scroll/confine it to a scroll view...
This commit is contained in:
parent
ab2065e5ba
commit
842815b2e0
|
@ -140,7 +140,7 @@ uintptr_t *NSIndexSetEntries(id indexset, uintptr_t count)
|
|||
size_t countsize;
|
||||
|
||||
if (getIndexes_init == NO) {
|
||||
getIndexes = sel_getUid("getIndexes:maxCount:inRange:");
|
||||
getIndexes = sel_getUid("getIndexes:maxCount:inIndexRange:");
|
||||
getIndexes_init = YES;
|
||||
}
|
||||
countsize = (size_t) count;
|
||||
|
|
|
@ -58,7 +58,7 @@ NSArrayController is what we bind.
|
|||
This is what provides the actual list modification methods.
|
||||
- (void)addObject:(id)object
|
||||
adds object to the end of the list
|
||||
- (void)insertObject:(id)object atArrangedObjectsIndex:(NSInteger)index
|
||||
- (void)insertObject:(id)object atArrangedObjectIndex:(NSInteger)index
|
||||
adds object in the list before index
|
||||
- (void)removeObjectAtArrangedObjectIndex:(NSInteger)index
|
||||
removes the object at index
|
||||
|
@ -75,8 +75,8 @@ var (
|
|||
|
||||
_setAutomaticallyRearrangesObjects = sel_getUid("setAutomaticallyRearrangesObjects:")
|
||||
_addObject = sel_getUid("addObject:")
|
||||
_insertObjectAtArrangedObjectsIndex = sel_getUid("insertObject:atArrangedObjectsIndex:")
|
||||
_removeObjectAtArrangedObjectsIndex = sel_getUid("removeObjectAtArrangedObjectsIndex:")
|
||||
_insertObjectAtArrangedObjectIndex = sel_getUid("insertObject:atArrangedObjectIndex:")
|
||||
_removeObjectAtArrangedObjectIndex = sel_getUid("removeObjectAtArrangedObjectIndex:")
|
||||
_arrangedObjects = sel_getUid("arrangedObjects")
|
||||
_objectAtIndex = sel_getUid("objectAtIndex:")
|
||||
)
|
||||
|
@ -92,12 +92,12 @@ func appendListboxArray(array C.id, what string) {
|
|||
}
|
||||
|
||||
func insertListboxArrayBefore(array C.id, what string, before int) {
|
||||
C.objc_msgSend_id_uint(array, _insertObjectAtArrangedObjectsIndex,
|
||||
C.objc_msgSend_id_uint(array, _insertObjectAtArrangedObjectIndex,
|
||||
toListboxItem(what), C.uintptr_t(before))
|
||||
}
|
||||
|
||||
func deleteListboxArray(array C.id, index int) {
|
||||
objc_msgSend_uint(array, _removeObjectAtArrangedObjectsIndex, uintptr(index))
|
||||
objc_msgSend_uint(array, _removeObjectAtArrangedObjectIndex, uintptr(index))
|
||||
}
|
||||
|
||||
func indexListboxArray(array C.id, index int) string {
|
||||
|
|
2
todo.md
2
todo.md
|
@ -29,9 +29,11 @@ important things:
|
|||
- because the main event loop is not called if initialization fails, it is presently impossible for MsgBoxError() to work if UI initialization fails; this basically means we cannot allow initializiation to fail on Mac OS X if we want to be able to report UI init failures to the user with one
|
||||
- Cocoa coordinates have (0,0) at the bottom left: need to fix this somehow
|
||||
- I think Cocoa NSButton text is not vertically aligned properly...?
|
||||
- NSPopUpButton doesn't seem to allow no initial selection? need to be sure
|
||||
- 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)
|
||||
- figure out what to do about deleting a nonexistent item; each backend responds differently by default
|
||||
- some Cocoa controls don't seem to resize correctly: Buttons have space around the edges and don't satisfy stretchiness; Labels in the grid test window get cropped
|
||||
- find out how to deselect the first item in the NSTableView when first creating the Listbox (to make it work like on other platforms)
|
||||
- there's no GTK+ error handling whatsoever; we need to figure out how it works
|
||||
- make sure GTK+ documentation point differences don't matter
|
||||
- button sizes and LineEdit sizes on Windows seem too big; Comboboxes have margins
|
||||
|
|
Loading…
Reference in New Issue