summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkWidget.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2010-01-31 22:50:55 (GMT)
committerjenglish <jenglish@flightlab.com>2010-01-31 22:50:55 (GMT)
commitb8c9d13aa05cbfcbbe02e7c35a467b6043128989 (patch)
treeb05e13d2fe6e468becf1ed719e0768c481dbe97d /generic/ttk/ttkWidget.c
parent9eb9490bdd0af957334eed8ed99c60c0223d9536 (diff)
downloadtk-b8c9d13aa05cbfcbbe02e7c35a467b6043128989.zip
tk-b8c9d13aa05cbfcbbe02e7c35a467b6043128989.tar.gz
tk-b8c9d13aa05cbfcbbe02e7c35a467b6043128989.tar.bz2
Change signature of widget subcommand procedures to match Tcl_ObjCmdProc.
Merge now-redundant ensemble dispatch code.
Diffstat (limited to 'generic/ttk/ttkWidget.c')
-rw-r--r--generic/ttk/ttkWidget.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index de29d35..f6f3885 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWidget.c,v 1.23 2010/01/13 23:08:13 nijtmans Exp $
+/* $Id: ttkWidget.c,v 1.24 2010/01/31 22:50:56 jenglish Exp $
* Copyright (c) 2003, Joe English
*
* Core widget utilities.
@@ -146,30 +146,6 @@ void TtkWidgetChangeState(WidgetCore *corePtr,
}
}
-/* TtkWidgetEnsembleCommand --
- * Invoke an ensemble defined by a WidgetCommandSpec.
- */
-int TtkWidgetEnsembleCommand(
- const WidgetCommandSpec *commands, /* Ensemble definition */
- int cmdIndex, /* Index of command word */
- Tcl_Interp *interp, /* Interpreter to use */
- int objc, Tcl_Obj *const objv[], /* Argument vector */
- void *clientData) /* User data (widget record pointer) */
-{
- int index;
-
- if (objc <= cmdIndex) {
- Tcl_WrongNumArgs(interp, cmdIndex, objv, "option ?arg arg...?");
- return TCL_ERROR;
- }
- if (Tcl_GetIndexFromObjStruct(interp, objv[cmdIndex], commands,
- sizeof(commands[0]), "command", 0, &index) != TCL_OK)
- {
- return TCL_ERROR;
- }
- return commands[index].command(interp, objc, objv, clientData);
-}
-
/* WidgetInstanceObjCmd --
* Widget instance command implementation.
*/
@@ -178,11 +154,11 @@ WidgetInstanceObjCmd(
ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = clientData;
- const WidgetCommandSpec *commands = corePtr->widgetSpec->commands;
+ const Ttk_Ensemble *commands = corePtr->widgetSpec->commands;
int status;
Tcl_Preserve(clientData);
- status = TtkWidgetEnsembleCommand(commands,1, interp,objc,objv,clientData);
+ status = Ttk_InvokeEnsemble(commands,1, clientData,interp,objc,objv);
Tcl_Release(clientData);
return status;
@@ -615,7 +591,7 @@ int TtkWidgetSize(void *recordPtr, int *widthPtr, int *heightPtr)
/* $w cget -option
*/
int TtkWidgetCgetCommand(
-Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = recordPtr;
Tcl_Obj *result;
@@ -635,7 +611,7 @@ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
/* $w configure ?-option ?value ....??
*/
int TtkWidgetConfigureCommand(
-Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = recordPtr;
Tcl_Obj *result;
@@ -704,7 +680,7 @@ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
*/
int TtkWidgetStateCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = recordPtr;
Ttk_StateSpec spec;
@@ -744,7 +720,7 @@ int TtkWidgetStateCommand(
*/
int TtkWidgetInstateCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = recordPtr;
Ttk_State state = corePtr->state;
@@ -775,7 +751,7 @@ int TtkWidgetInstateCommand(
* Returns: name of element at $x, $y
*/
int TtkWidgetIdentifyCommand(
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr)
+ void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
WidgetCore *corePtr = recordPtr;
Ttk_Element element;