diff options
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkBlink.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkButton.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkClamTheme.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkClassicTheme.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 24 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkManager.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 24 | ||||
-rw-r--r-- | generic/ttk/ttkPanedwindow.c | 10 | ||||
-rw-r--r-- | generic/ttk/ttkProgress.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkScale.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkScroll.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkScrollbar.c | 14 | ||||
-rw-r--r-- | generic/ttk/ttkSeparator.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkTrace.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 46 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.c | 2 |
17 files changed, 78 insertions, 86 deletions
diff --git a/generic/ttk/ttkBlink.c b/generic/ttk/ttkBlink.c index dcd342c..fc48af9 100644 --- a/generic/ttk/ttkBlink.c +++ b/generic/ttk/ttkBlink.c @@ -59,7 +59,7 @@ static CursorManager *GetCursorManager(Tcl_Interp *interp) cm->owner = 0; cm->onTime = DEF_CURSOR_ON_TIME; cm->offTime = DEF_CURSOR_OFF_TIME; - Tcl_SetAssocData(interp,cm_key,CursorManagerDeleteProc,(ClientData)cm); + Tcl_SetAssocData(interp, cm_key, CursorManagerDeleteProc, cm); } return cm; } diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 9712c66..919b4d4 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -823,7 +823,7 @@ static const Tk_OptionSpec MenubuttonOptionSpecs[] = "", offsetof(Menubutton, menubutton.menuObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", "below", offsetof(Menubutton, menubutton.directionObj), TCL_INDEX_NONE, - 0,(ClientData)directionStrings,GEOMETRY_CHANGED}, + 0,(void *)directionStrings,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) @@ -858,7 +858,7 @@ TTK_BEGIN_LAYOUT(MenubuttonLayout) TTK_GROUP("Menubutton.border", TTK_FILL_BOTH, TTK_GROUP("Menubutton.focus", TTK_FILL_BOTH, TTK_NODE("Menubutton.indicator", TTK_PACK_RIGHT) - TTK_GROUP("Menubutton.padding", TTK_PACK_LEFT|TTK_EXPAND|TTK_FILL_X, + TTK_GROUP("Menubutton.padding", TTK_FILL_X, TTK_NODE("Menubutton.label", TTK_PACK_LEFT)))) TTK_END_LAYOUT diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index dae54e4..035cabc 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -955,7 +955,7 @@ TTK_BEGIN_LAYOUT_TABLE(LayoutTable) TTK_LAYOUT("TCombobox", TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) - TTK_GROUP("Combobox.field", TTK_PACK_LEFT|TTK_FILL_BOTH|TTK_EXPAND, + TTK_GROUP("Combobox.field", TTK_FILL_BOTH, TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, TTK_NODE("Combobox.textarea", TTK_FILL_BOTH)))) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index ec35480..be7d74b 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -453,7 +453,7 @@ TTK_LAYOUT("TMenubutton", TTK_GROUP("Menubutton.highlight", TTK_FILL_BOTH, TTK_GROUP("Menubutton.border", TTK_FILL_BOTH, TTK_NODE("Menubutton.indicator", TTK_PACK_RIGHT) - TTK_GROUP("Menubutton.padding", TTK_PACK_LEFT|TTK_EXPAND|TTK_FILL_X, + TTK_GROUP("Menubutton.padding", TTK_FILL_X, TTK_NODE("Menubutton.label", 0))))) /* "classic" entry, includes highlight border */ diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 4314a83..946b7fc 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -181,7 +181,7 @@ static const Tk_OptionSpec EntryOptionSpecs[] = { TK_OPTION_NULL_OK,0,TEXTVAR_CHANGED}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", "none", TCL_INDEX_NONE, offsetof(Entry, entry.validate), - 0, (ClientData) validateStrings, 0}, + 0, (void *) validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand", NULL, TCL_INDEX_NONE, offsetof(Entry, entry.validateCmd), TK_OPTION_NULL_OK, 0, 0}, @@ -403,7 +403,7 @@ static void EntryOwnSelection(Entry *entryPtr) && (!Tcl_IsSafe(entryPtr->core.interp)) && !(entryPtr->core.flags & GOT_SELECTION)) { Tk_OwnSelection(entryPtr->core.tkwin, XA_PRIMARY, EntryLostSelection, - (ClientData) entryPtr); + entryPtr); entryPtr->core.flags |= GOT_SELECTION; } } @@ -600,9 +600,9 @@ EntryValidateChange( VMODE vmode = entryPtr->entry.validate; int code, change_ok; - if ( (entryPtr->entry.validateCmd == NULL) + if ((entryPtr->entry.validateCmd == NULL) || (entryPtr->core.flags & VALIDATING) - || !EntryNeedsValidation(vmode, reason) ) + || !EntryNeedsValidation(vmode, reason)) { return TCL_OK; } @@ -958,7 +958,7 @@ EntryInitialize(Tcl_Interp *dummy, void *recordPtr) Tk_CreateEventHandler( entryPtr->core.tkwin, EntryEventMask, EntryEventProc, entryPtr); Tk_CreateSelHandler(entryPtr->core.tkwin, XA_PRIMARY, XA_STRING, - EntryFetchSelection, (ClientData) entryPtr, XA_STRING); + EntryFetchSelection, entryPtr, XA_STRING); TtkBlinkCursor(&entryPtr->core); entryPtr->entry.string = (char *)ckalloc(1); @@ -1393,7 +1393,7 @@ EntryIndex( const char *string; if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->entry.numChars - 1, 1, &idx)) { - if (idx + 1 > entryPtr->entry.numChars + 1) { + if ((idx != TCL_INDEX_NONE) && (idx > entryPtr->entry.numChars)) { idx = entryPtr->entry.numChars; } *indexPtr = idx; @@ -1577,7 +1577,7 @@ EntryIndexCommand( if (EntryIndex(interp, entryPtr, objv[2], &index) != TCL_OK) { return TCL_ERROR; } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index)); + Tcl_SetObjResult(interp, TkNewIndexObj(index)); return TCL_OK; } @@ -1650,7 +1650,7 @@ static int EntrySelectionRangeCommand( Tcl_WrongNumArgs(interp, 3, objv, "start end"); return TCL_ERROR; } - if ( EntryIndex(interp, entryPtr, objv[3], &start) != TCL_OK + if (EntryIndex(interp, entryPtr, objv[3], &start) != TCL_OK || EntryIndex(interp, entryPtr, objv[4], &end) != TCL_OK) { return TCL_ERROR; } @@ -1711,7 +1711,7 @@ static int EntryValidateCommand( if (code == TCL_ERROR) return code; - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(code == TCL_OK)); + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(code == TCL_OK)); return TCL_OK; } @@ -1849,7 +1849,7 @@ static int ComboboxCurrentCommand( if (objc == 2) { /* Check if currentIndex still valid: */ - if ( currentIndex == TCL_INDEX_NONE + if (currentIndex == TCL_INDEX_NONE || currentIndex >= (TkSizeT)nValues || strcmp(currentValue,Tcl_GetString(values[currentIndex])) ) @@ -1867,7 +1867,7 @@ static int ComboboxCurrentCommand( } } cbPtr->combobox.currentIndex = currentIndex; - Tcl_SetObjResult(interp, Tcl_NewWideIntObj((int)currentIndex)); + Tcl_SetObjResult(interp, TkNewIndexObj(currentIndex)); return TCL_OK; } else if (objc == 3) { TkSizeT idx; @@ -2109,7 +2109,7 @@ TTK_END_LAYOUT TTK_BEGIN_LAYOUT(ComboboxLayout) TTK_GROUP("Combobox.field", TTK_FILL_BOTH, TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) - TTK_GROUP("Combobox.padding", TTK_FILL_BOTH|TTK_PACK_LEFT|TTK_EXPAND, + TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, TTK_NODE("Combobox.textarea", TTK_FILL_BOTH))) TTK_END_LAYOUT diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index a39ae2b..a971d23 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -809,7 +809,7 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) APPENDSTR("-sticky"); APPENDOBJ(Ttk_NewStickyObj(flags & _TTK_MASK_STICK)); - /* @@@ Check again: are these necessary? */ + /* @@@ Check again: are these necessary? Can't see any effect! */ if (flags & TTK_BORDER) { APPENDSTR("-border"); APPENDSTR("1"); } if (flags & TTK_UNIT) { APPENDSTR("-unit"); APPENDSTR("1"); } diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 5fa9918..c01bc47 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -261,10 +261,10 @@ static void InsertSlave(Ttk_Manager *mgr, Ttk_Slave *slave, TkSizeT index) mgr->slaves[index] = slave; Tk_ManageGeometry(slave->slaveWindow, - &mgr->managerSpec->tkGeomMgr, (ClientData)mgr); + &mgr->managerSpec->tkGeomMgr, mgr); Tk_CreateEventHandler(slave->slaveWindow, - SlaveEventMask, SlaveEventHandler, (ClientData)slave); + SlaveEventMask, SlaveEventHandler, slave); ScheduleUpdate(mgr, MGR_RESIZE_REQUIRED); } diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index d0151f7..95125d3 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -59,25 +59,25 @@ static const Tk_OptionSpec TabOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", "", "", "normal", TCL_INDEX_NONE, offsetof(Tab,state), - 0,(ClientData)TabStateStrings,0 }, + 0, (void *)TabStateStrings, 0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", - offsetof(Tab,textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,textObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, - offsetof(Tab,imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + offsetof(Tab,imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", NULL, offsetof(Tab,compoundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,(void *)ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", "-1", - offsetof(Tab,underlineObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,underlineObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } }; static const Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_STRING, "-padding", "padding", "Padding", "0", - offsetof(Tab,paddingObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,paddingObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-sticky", "sticky", "Sticky", "nsew", - offsetof(Tab,stickyObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,stickyObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, WIDGET_INHERIT_OPTIONS(TabOptionSpecs) }; @@ -1079,7 +1079,7 @@ static int NotebookIdentifyCommand( return TCL_ERROR; } - if ( Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK + if (Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK || Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK || (objc == 5 && Tcl_GetIndexFromObjStruct(interp, objv[2], whatTable, sizeof(char *), "option", 0, &what) != TCL_OK) @@ -1108,9 +1108,8 @@ static int NotebookIdentifyCommand( } break; case IDENTIFY_TAB: - if (tabIndex != TCL_INDEX_NONE) { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(tabIndex)); - } + if (tabIndex != TCL_INDEX_NONE) + Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); break; } return TCL_OK; @@ -1134,8 +1133,9 @@ static int NotebookIndexCommand( } status = FindTabIndex(interp, nb, objv[2], &index); - if (status == TCL_OK && index != TCL_INDEX_NONE) { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index)); + if (status == TCL_OK) { + if (index != TCL_INDEX_NONE) + Tcl_SetObjResult(interp, TkNewIndexObj(index)); } return status; diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 5d925de..09b633b 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -77,13 +77,13 @@ typedef struct { static const Tk_OptionSpec PanedOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", offsetof(Paned,paned.orientObj), offsetof(Paned,paned.orient), - 0,(ClientData)ttkOrientStrings,READONLY_OPTION|STYLE_CHANGED }, + 0, (void *)ttkOrientStrings, READONLY_OPTION|STYLE_CHANGED }, {TK_OPTION_INT, "-width", "width", "Width", "0", - TCL_INDEX_NONE, offsetof(Paned,paned.width), - 0,0,GEOMETRY_CHANGED }, + TCL_INDEX_NONE, offsetof(Paned, paned.width), + 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_INT, "-height", "height", "Height", "0", - TCL_INDEX_NONE, offsetof(Paned,paned.height), - 0,0,GEOMETRY_CHANGED }, + TCL_INDEX_NONE, offsetof(Paned, paned.height), + 0, 0, GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 505748b..a025885 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -71,10 +71,10 @@ static const Tk_OptionSpec ProgressbarOptionSpecs[] = {TK_OPTION_STRING_TABLE, "-mode", "mode", "ProgressMode", "determinate", offsetof(Progressbar,progress.modeObj), offsetof(Progressbar,progress.mode), - 0, (ClientData)ProgressbarModeStrings, 0 }, + 0, (void *)ProgressbarModeStrings, 0 }, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", offsetof(Progressbar,progress.orientObj), TCL_INDEX_NONE, - 0, (ClientData)ttkOrientStrings, STYLE_CHANGED }, + 0, (void *)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_INT, "-phase", "phase", "Phase", "0", offsetof(Progressbar,progress.phaseObj), TCL_INDEX_NONE, 0, 0, 0 }, diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index a2c5d59..6c9867a 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -57,11 +57,11 @@ static const Tk_OptionSpec ScaleOptionSpecs[] = TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", "", offsetof(Scale,scale.variableObj), TCL_INDEX_NONE, - 0,0,0}, + 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", offsetof(Scale,scale.orientObj), offsetof(Scale,scale.orient), 0, - (ClientData)ttkOrientStrings, STYLE_CHANGED }, + (void *)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_DOUBLE, "-from", "from", "From", "0", offsetof(Scale,scale.fromObj), TCL_INDEX_NONE, 0, 0, 0}, @@ -75,7 +75,7 @@ static const Tk_OptionSpec ScaleOptionSpecs[] = {TK_OPTION_STRING, "-state", "state", "State", "normal", offsetof(Scale,scale.stateObj), TCL_INDEX_NONE, - 0,0,STATE_CHANGED}, + 0, 0, STATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index b031dc6..69370c9 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -130,12 +130,12 @@ static void UpdateScrollbarBG(ClientData clientData) int code; h->flags &= ~SCROLL_UPDATE_PENDING; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); code = UpdateScrollbar(interp, h); if (code == TCL_ERROR && !Tcl_InterpDeleted(interp)) { Tcl_BackgroundException(interp, code); } - Tcl_Release((ClientData) interp); + Tcl_Release(interp); } /* TtkScrolled -- @@ -167,7 +167,7 @@ void TtkScrolled(ScrollHandle h, int first, int last, int total) s->total = total; if (!(h->flags & SCROLL_UPDATE_PENDING)) { - Tcl_DoWhenIdle(UpdateScrollbarBG, (ClientData)h); + Tcl_DoWhenIdle(UpdateScrollbarBG, h); h->flags |= SCROLL_UPDATE_PENDING; } } @@ -274,7 +274,7 @@ void TtkScrollTo(ScrollHandle h, int newFirst, int updateScrollInfo) void TtkFreeScrollHandle(ScrollHandle h) { if (h->flags & SCROLL_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateScrollbarBG, (ClientData)h); + Tcl_CancelIdleCall(UpdateScrollbarBG, h); } ckfree(h); } diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 1b915cc..54923ff 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -34,12 +34,12 @@ typedef struct static const Tk_OptionSpec ScrollbarOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - offsetof(Scrollbar,scrollbar.commandObj), TCL_INDEX_NONE, 0,0,0}, + offsetof(Scrollbar, scrollbar.commandObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", - offsetof(Scrollbar,scrollbar.orientObj), - offsetof(Scrollbar,scrollbar.orient), - 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, + offsetof(Scrollbar, scrollbar.orientObj), + offsetof(Scrollbar, scrollbar.orient), + 0, (void *)ttkOrientStrings, STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) @@ -316,16 +316,14 @@ TTK_BEGIN_LAYOUT(VerticalScrollbarLayout) TTK_GROUP("Vertical.Scrollbar.trough", TTK_FILL_Y, TTK_NODE("Vertical.Scrollbar.uparrow", TTK_PACK_TOP) TTK_NODE("Vertical.Scrollbar.downarrow", TTK_PACK_BOTTOM) - TTK_NODE( - "Vertical.Scrollbar.thumb", TTK_PACK_TOP|TTK_EXPAND|TTK_FILL_BOTH)) + TTK_NODE("Vertical.Scrollbar.thumb", TTK_FILL_BOTH)) TTK_END_LAYOUT TTK_BEGIN_LAYOUT(HorizontalScrollbarLayout) TTK_GROUP("Horizontal.Scrollbar.trough", TTK_FILL_X, TTK_NODE("Horizontal.Scrollbar.leftarrow", TTK_PACK_LEFT) TTK_NODE("Horizontal.Scrollbar.rightarrow", TTK_PACK_RIGHT) - TTK_NODE( - "Horizontal.Scrollbar.thumb", TTK_PACK_LEFT|TTK_EXPAND|TTK_FILL_BOTH)) + TTK_NODE("Horizontal.Scrollbar.thumb", TTK_FILL_BOTH)) TTK_END_LAYOUT /*------------------------------------------------------------------------ diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index 00605dc..a3141da 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -26,7 +26,7 @@ static const Tk_OptionSpec SeparatorOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", offsetof(Separator,separator.orientObj), offsetof(Separator,separator.orient), - 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, + 0, (void *)ttkOrientStrings,STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index 7e02b58..d086c02 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -53,7 +53,7 @@ VarTraceProc( */ if (tracePtr->interp == NULL) { Tcl_DecrRefCount(tracePtr->varnameObj); - ckfree((ClientData)tracePtr); + ckfree(tracePtr); return NULL; } Tcl_TraceVar2(interp, name, NULL, @@ -98,7 +98,7 @@ Ttk_TraceHandle *Ttk_TraceVariable( status = Tcl_TraceVar2(interp, Tcl_GetString(varnameObj), NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - VarTraceProc, (ClientData)h); + VarTraceProc, h); if (status != TCL_OK) { Tcl_DecrRefCount(h->varnameObj); @@ -139,7 +139,7 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h) */ while ((cd = Tcl_VarTraceInfo(h->interp, Tcl_GetString(h->varnameObj), TCL_GLOBAL_ONLY, VarTraceProc, cd)) != NULL) { - if (cd == (ClientData) h) { + if (cd == h) { break; } } @@ -154,7 +154,7 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h) } Tcl_UntraceVar2(h->interp, Tcl_GetString(h->varnameObj), NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - VarTraceProc, (ClientData)h); + VarTraceProc, h); Tcl_DecrRefCount(h->varnameObj); ckfree(h); } diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 699a10b..4ea4c17 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -441,21 +441,21 @@ static const char *const SelectModeStrings[] = { "none", "browse", "extended", N static const Tk_OptionSpec TreeviewOptionSpecs[] = { {TK_OPTION_STRING, "-columns", "columns", "Columns", "", offsetof(Treeview,tree.columnsObj), TCL_INDEX_NONE, - 0,0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ }, + 0, 0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ }, {TK_OPTION_STRING, "-displaycolumns","displayColumns","DisplayColumns", "#all", offsetof(Treeview,tree.displayColumnsObj), TCL_INDEX_NONE, - 0,0,DCOLUMNS_CHANGED | GEOMETRY_CHANGED }, + 0, 0,DCOLUMNS_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-show", "show", "Show", DEFAULT_SHOW, offsetof(Treeview,tree.showObj), TCL_INDEX_NONE, - 0,0,SHOW_CHANGED | GEOMETRY_CHANGED }, + 0, 0,SHOW_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", "extended", offsetof(Treeview,tree.selectModeObj), TCL_INDEX_NONE, - 0,(ClientData)SelectModeStrings,0 }, + 0, (void *)SelectModeStrings, 0 }, {TK_OPTION_PIXELS, "-height", "height", "Height", DEF_TREE_ROWS, offsetof(Treeview,tree.heightObj), TCL_INDEX_NONE, - 0,0,GEOMETRY_CHANGED}, + 0, 0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, offsetof(Treeview,tree.paddingObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, @@ -792,9 +792,8 @@ static int PickupSlack(Treeview *tv, int extra) { int newSlack = tv->tree.slack + extra; - if ( (newSlack < 0 && 0 <= tv->tree.slack) - || (newSlack > 0 && 0 >= tv->tree.slack)) - { + if ((newSlack < 0 && 0 <= tv->tree.slack) + || (newSlack > 0 && 0 >= tv->tree.slack)) { tv->tree.slack = 0; return newSlack; } else { @@ -1101,10 +1100,9 @@ TreeviewConfigure(Tcl_Interp *interp, void *recordPtr, int mask) TtkScrollbarUpdateRequired(tv->tree.xscrollHandle); TtkScrollbarUpdateRequired(tv->tree.yscrollHandle); } - if ( (mask & SHOW_CHANGED) - && GetEnumSetFromObj( - interp,tv->tree.showObj,showStrings,&showFlags) != TCL_OK) - { + if ((mask & SHOW_CHANGED) + && GetEnumSetFromObj( + interp,tv->tree.showObj,showStrings,&showFlags) != TCL_OK) { return TCL_ERROR; } @@ -1780,7 +1778,7 @@ static void DrawItem( x+indent, y, colwidth-indent, rowHeight); if (item->textObj) { displayItem.textObj = item->textObj; } if (item->imageObj) { displayItem.imageObj = item->imageObj; } - /* ??? displayItem.anchorObj = 0; <<NOTE-ANCHOR>> */ + displayItem.anchorObj = tv->tree.column0.anchorObj; DisplayLayout(tv->tree.itemLayout, &displayItem, state, parcel, d); x += colwidth; } @@ -2109,7 +2107,7 @@ static int TreeviewIndexCommand( { Treeview *tv = (Treeview *)recordPtr; TreeItem *item; - int index = 0; + TkSizeT index = 0; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "item"); @@ -2125,7 +2123,7 @@ static int TreeviewIndexCommand( item = item->prev; } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index)); + Tcl_SetObjResult(interp, TkNewIndexObj(index)); return TCL_OK; } @@ -2201,9 +2199,8 @@ static int TreeviewHorribleIdentify( /* ASSERT: objc == 4 */ - if ( Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK - ) { + if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK + || Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) { return TCL_ERROR; } @@ -2750,9 +2747,8 @@ static int TreeviewMoveCommand( Tcl_WrongNumArgs(interp, 2, objv, "item parent index"); return TCL_ERROR; } - if ( (item = FindItem(interp, tv, objv[2])) == 0 - || (parent = FindItem(interp, tv, objv[3])) == 0) - { + if ((item = FindItem(interp, tv, objv[2])) == 0 + || (parent = FindItem(interp, tv, objv[3])) == 0) { return TCL_ERROR; } @@ -2879,9 +2875,8 @@ static int TreeviewDragCommand( return TCL_ERROR; } - if ( (column = FindColumn(interp, tv, objv[2])) == 0 - || Tcl_GetIntFromObj(interp, objv[3], &newx) != TCL_OK) - { + if ((column = FindColumn(interp, tv, objv[2])) == 0 + || Tcl_GetIntFromObj(interp, objv[3], &newx) != TCL_OK) { return TCL_ERROR; } @@ -3351,8 +3346,7 @@ TTK_LAYOUT("Item", TTK_GROUP("Treeitem.padding", TTK_FILL_BOTH, TTK_NODE("Treeitem.indicator", TTK_PACK_LEFT) TTK_NODE("Treeitem.image", TTK_PACK_LEFT) - TTK_GROUP("Treeitem.focus", TTK_PACK_LEFT, - TTK_NODE("Treeitem.text", TTK_PACK_LEFT)))) + TTK_NODE("Treeitem.text", TTK_FILL_BOTH))) TTK_LAYOUT("Cell", TTK_GROUP("Treedata.padding", TTK_FILL_BOTH, diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index df6e6be..6726e17 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -213,7 +213,7 @@ DestroyWidget(WidgetCore *corePtr) corePtr->widgetSpec->cleanupProc(corePtr); Tk_FreeConfigOptions( - (ClientData)corePtr, corePtr->optionTable, corePtr->tkwin); + corePtr, corePtr->optionTable, corePtr->tkwin); if (corePtr->layout) { Ttk_FreeLayout(corePtr->layout); |