diff options
Diffstat (limited to 'generic/ttk/ttkScrollbar.c')
-rw-r--r-- | generic/ttk/ttkScrollbar.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 82bb880..d0f91de 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -1,4 +1,4 @@ -/* $Id: ttkScrollbar.c,v 1.7 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkScrollbar.c,v 1.7.2.1 2010/08/26 02:06:09 hobbs Exp $ * Copyright (c) 2003, Joe English * * ttk::scrollbar widget. @@ -49,7 +49,7 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] = * +++ Widget hooks. */ -static int +static void ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr) { Scrollbar *sb = recordPtr; @@ -57,8 +57,6 @@ ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr) sb->scrollbar.last = 1.0; TtkTrackElementState(&sb->core); - - return TCL_OK; } static Ttk_Layout ScrollbarGetLayout( @@ -80,7 +78,7 @@ static void ScrollbarDoLayout(void *recordPtr) { Scrollbar *sb = recordPtr; WidgetCore *corePtr = &sb->core; - Ttk_LayoutNode *thumb; + Ttk_Element thumb; Ttk_Box thumbBox; int thumbWidth, thumbHeight; double first, last, size; @@ -94,11 +92,11 @@ static void ScrollbarDoLayout(void *recordPtr) /* * Locate thumb element, extract parcel and requested minimum size: */ - thumb = Ttk_LayoutFindNode(corePtr->layout, "thumb"); + thumb = Ttk_FindElement(corePtr->layout, "thumb"); if (!thumb) /* Something has gone wrong -- bail */ return; - sb->scrollbar.troughBox = thumbBox = Ttk_LayoutNodeParcel(thumb); + sb->scrollbar.troughBox = thumbBox = Ttk_ElementParcel(thumb); Ttk_LayoutNodeReqSize( corePtr->layout, thumb, &thumbWidth,&thumbHeight); @@ -120,7 +118,7 @@ static void ScrollbarDoLayout(void *recordPtr) thumbBox.width = (int)(size * last) + minSize - (int)(size * first); } sb->scrollbar.minSize = minSize; - Ttk_PlaceLayoutNode(corePtr->layout, thumb, thumbBox); + Ttk_PlaceElement(corePtr->layout, thumb, thumbBox); } /*------------------------------------------------------------------------ @@ -132,7 +130,7 @@ static void ScrollbarDoLayout(void *recordPtr) */ static int ScrollbarSetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Scrollbar *scrollbar = recordPtr; Tcl_Obj *firstObj, *lastObj; @@ -183,7 +181,7 @@ ScrollbarSetCommand( */ static int ScrollbarGetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Scrollbar *scrollbar = recordPtr; Tcl_Obj *result[2]; @@ -206,7 +204,7 @@ ScrollbarGetCommand( */ static int ScrollbarDeltaCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Scrollbar *sb = recordPtr; double dx, dy; @@ -246,7 +244,7 @@ ScrollbarDeltaCommand( */ static int ScrollbarFractionCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Scrollbar *sb = recordPtr; Ttk_Box b = sb->scrollbar.troughBox; @@ -280,18 +278,17 @@ ScrollbarFractionCommand( return TCL_OK; } -static WidgetCommandSpec ScrollbarCommands[] = -{ - { "configure", TtkWidgetConfigureCommand }, - { "cget", TtkWidgetCgetCommand }, - { "delta", ScrollbarDeltaCommand }, - { "fraction", ScrollbarFractionCommand }, - { "get", ScrollbarGetCommand }, - { "identify", TtkWidgetIdentifyCommand }, - { "instate", TtkWidgetInstateCommand }, - { "set", ScrollbarSetCommand }, - { "state", TtkWidgetStateCommand }, - { 0,0 } +static const Ttk_Ensemble ScrollbarCommands[] = { + { "configure", TtkWidgetConfigureCommand,0 }, + { "cget", TtkWidgetCgetCommand,0 }, + { "delta", ScrollbarDeltaCommand,0 }, + { "fraction", ScrollbarFractionCommand,0 }, + { "get", ScrollbarGetCommand,0 }, + { "identify", TtkWidgetIdentifyCommand,0 }, + { "instate", TtkWidgetInstateCommand,0 }, + { "set", ScrollbarSetCommand,0 }, + { "state", TtkWidgetStateCommand,0 }, + { 0,0,0 } }; /*------------------------------------------------------------------------ |