From 61ab162b6375218986ca3883d6b991fa27717da6 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 2 May 2020 02:36:48 +0000 Subject: Restore sheets to file dialogs on macOS --- macosx/tkMacOSXDialog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 10a756d..4ff0f89 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -343,7 +343,7 @@ static NSInteger showOpenSavePanel( { NSInteger modalReturnCode; - if (parent && ![parent attachedSheet] && [NSApp macMinorVersion] < 15) { + if (parent && ![parent attachedSheet]) { [panel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:panel -- cgit v0.12 From 3665af3d8edf5eef718cf79a384c397de8c8b4cb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 3 May 2020 09:07:01 +0000 Subject: Fix [88c9e0928b]: Treeview: wrong keyboard navigation with -selectmode none. Patch from Emiliano Gavilan. --- library/ttk/treeview.tcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 81ba27e..a9f623c 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -265,9 +265,9 @@ proc ttk::treeview::SelectOp {w item op} { ## -selectmode none: # -proc ttk::treeview::select.choose.none {w item} { $w focus $item } -proc ttk::treeview::select.toggle.none {w item} { $w focus $item } -proc ttk::treeview::select.extend.none {w item} { $w focus $item } +proc ttk::treeview::select.choose.none {w item} { $w focus $item; $w see $item } +proc ttk::treeview::select.toggle.none {w item} { $w focus $item; $w see $item } +proc ttk::treeview::select.extend.none {w item} { $w focus $item; $w see $item } ## -selectmode browse: # -- cgit v0.12 From 50f4e918ac351ad527226b3a1939afef73c419fb Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 6 May 2020 16:59:17 +0000 Subject: Avoid warnings by calling [panel runModal] instead of [NSApp runModalForWindow:panel] --- macosx/tkMacOSXDialog.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 4ff0f89..76bb742 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -210,7 +210,8 @@ getFileURL( } - (void) tkFilePanelDidEnd: (NSSavePanel *) panel - returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo + returnCode: (NSModalResponse) returnCode + contextInfo: (void *) contextInfo { FilePanelCallbackInfo *callbackInfo = contextInfo; @@ -345,13 +346,14 @@ static NSInteger showOpenSavePanel( if (parent && ![parent attachedSheet]) { [panel beginSheetModalForWindow:parent - completionHandler:^(NSInteger returnCode) { + completionHandler:^(NSModalResponse returnCode) { [NSApp tkFilePanelDidEnd:panel returnCode:returnCode contextInfo:callbackInfo ]; }]; + modalReturnCode = callbackInfo->cmdObj ? modalOther : - [NSApp runModalForWindow:panel]; + [panel runModal]; } else { modalReturnCode = [panel runModal]; [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode @@ -654,8 +656,6 @@ Tk_GetOpenFileObjCmd( NSInteger modalReturnCode = modalError; BOOL parentIsKey = NO; - [openpanel setDelegate:NSApp]; - for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { @@ -928,8 +928,6 @@ Tk_GetSaveFileObjCmd( NSInteger modalReturnCode = modalError; BOOL parentIsKey = NO; - [savepanel setDelegate:NSApp]; - for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { @@ -1171,8 +1169,6 @@ Tk_ChooseDirectoryObjCmd( NSInteger modalReturnCode = modalError; BOOL parentIsKey = NO; - [panel setDelegate:NSApp]; - for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { -- cgit v0.12