Skip to content

Commit

Permalink
ui/cocoa: Fix setting up NSTableView delegate. #22
Browse files Browse the repository at this point in the history
  • Loading branch information
roblillack committed Jun 28, 2024
1 parent 6f7e570 commit da85091
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/internal/cocoa/tableview.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (tableView *TableView) selectedRows() []int {
//export onTableViewSelectionDidChange
func onTableViewSelectionDidChange(id C.int) {
tableViewID := int(id)
if tableViewID < len(tableViews) && tableViews[tableViewID].callback != nil {
if tableViewID < len(tableViews) {
x := tableViews[tableViewID]
if x.callback != nil {
x.callback(x.selectedRows())
Expand Down
2 changes: 1 addition & 1 deletion ui/internal/cocoa/tableview.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TableViewPtr TableView_New(int goTableViewId, int x, int y, int w, int h) {
column.width = w;
[tableView addTableColumn:column];

TableViewController *d = [[[TableViewController alloc] init] autorelease];
TableViewController *d = [[TableViewController alloc] init];
d.goTableViewId = goTableViewId;

// This line removes the header view entirely
Expand Down

0 comments on commit da85091

Please sign in to comment.