summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkScrollbar.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-10-25 07:08:25 (GMT)
committerjenglish <jenglish@flightlab.com>2007-10-25 07:08:25 (GMT)
commit504f22c2002890ce5b39d30561d76cae861d0d40 (patch)
treecc3ec59b3743ffde75e375f9a9f2c21fcfbf95a2 /generic/ttk/ttkScrollbar.c
parenta9b41e61dd1f2274961a88385d433a9bac66d44a (diff)
downloadtk-504f22c2002890ce5b39d30561d76cae861d0d40.zip
tk-504f22c2002890ce5b39d30561d76cae861d0d40.tar.gz
tk-504f22c2002890ce5b39d30561d76cae861d0d40.tar.bz2
Move widget layout registration from TtkElements_Init()
to widget *_Init() routines. Renaming/consistency: s/...ElementGeometry()/...ElementSize()/
Diffstat (limited to 'generic/ttk/ttkScrollbar.c')
-rw-r--r--generic/ttk/ttkScrollbar.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c
index c3be30f..1e744c2 100644
--- a/generic/ttk/ttkScrollbar.c
+++ b/generic/ttk/ttkScrollbar.c
@@ -1,4 +1,4 @@
-/* $Id: ttkScrollbar.c,v 1.5 2007/01/11 14:49:47 jenglish Exp $
+/* $Id: ttkScrollbar.c,v 1.6 2007/10/25 07:08:26 jenglish Exp $
* Copyright (c) 2003, Joe English
*
* ttk::scrollbar widget.
@@ -313,6 +313,22 @@ static WidgetSpec ScrollbarWidgetSpec =
TtkWidgetDisplay /* displayProc */
};
+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_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_END_LAYOUT
+
/*------------------------------------------------------------------------
* +++ Initialization.
*/
@@ -320,7 +336,12 @@ static WidgetSpec ScrollbarWidgetSpec =
MODULE_SCOPE
void TtkScrollbar_Init(Tcl_Interp *interp)
{
+ Ttk_Theme theme = Ttk_GetDefaultTheme(interp);
+
+ Ttk_RegisterLayout(theme,"Vertical.TScrollbar",VerticalScrollbarLayout);
+ Ttk_RegisterLayout(theme,"Horizontal.TScrollbar",HorizontalScrollbarLayout);
+
RegisterWidget(interp, "ttk::scrollbar", &ScrollbarWidgetSpec);
-}
+}
/*EOF*/