summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenus.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXMenus.c')
-rw-r--r--macosx/tkMacOSXMenus.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index 1c033a4..1029704 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -199,6 +199,8 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
- (void) orderFrontStandardAboutPanel: (id) sender
{
+ (void)sender;
+
if (!_eventInterp || !Tcl_FindCommand(_eventInterp, "tkAboutDialog",
NULL, 0) || (GetCurrentEventKeyModifiers() & optionKey)) {
TkAboutDlg();
@@ -231,6 +233,8 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
- (void) tkSource: (id) sender
{
+ (void)sender;
+
if (_eventInterp) {
if (Tcl_EvalEx(_eventInterp, "tk_getOpenFile -filetypes {"
"{{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}",
@@ -256,6 +260,8 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
- (void) tkDemo: (id) sender
{
+ (void)sender;
+
if (_eventInterp) {
Tcl_Obj *path = GetWidgetDemoPath(_eventInterp);
@@ -281,6 +287,8 @@ static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>) anItem
{
+ (void)anItem;
+
return YES;
}
@@ -322,19 +330,18 @@ static Tcl_Obj *
GetWidgetDemoPath(
Tcl_Interp *interp)
{
- Tcl_Obj *libpath, *result = NULL;
+ Tcl_Obj *result = NULL;
- libpath = Tcl_GetVar2Ex(interp, "tk_library", NULL, TCL_GLOBAL_ONLY);
- if (libpath) {
- Tcl_Obj *demo[2] = { Tcl_NewStringObj("demos", 5),
- Tcl_NewStringObj("widget", 6) };
+ if (Tcl_EvalEx(interp, "::tk::pkgconfig get demodir,runtime",
+ -1, TCL_EVAL_GLOBAL) == TCL_OK) {
+ Tcl_Obj *libpath, *demo[1] = { Tcl_NewStringObj("widget", 6) };
+ libpath = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(libpath);
- result = Tcl_FSJoinToPath(libpath, 2, demo);
+ result = Tcl_FSJoinToPath(libpath, 1, demo);
Tcl_DecrRefCount(libpath);
- } else {
- Tcl_ResetResult(interp);
}
+ Tcl_ResetResult(interp);
return result;
}
@@ -356,9 +363,9 @@ GetWidgetDemoPath(
void
TkMacOSXHandleMenuSelect(
- short theMenu,
- unsigned short theItem,
- int optionKeyPressed)
+ TCL_UNUSED(short),
+ TCL_UNUSED(unsigned short),
+ TCL_UNUSED(int))
{
Tcl_Panic("TkMacOSXHandleMenuSelect: Obsolete, no more Carbon!");
}
@@ -381,7 +388,7 @@ TkMacOSXHandleMenuSelect(
void
TkMacOSXInitMenus(
- Tcl_Interp *interp)
+ TCL_UNUSED(Tcl_Interp *))
{
[NSApp _setupMenus];
}