diff options
author | dgp <dgp@users.sourceforge.net> | 2007-12-04 17:05:20 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-12-04 17:05:20 (GMT) |
commit | 68ae9855a65a2bee4130a02c1a3f464aca9d7e3b (patch) | |
tree | 37c6f768853ec6d9ec839445a8e844384142a737 /generic/ttk/ttkLayout.c | |
parent | 0a97d8c36b7cd622ada94fa095a9ee4fe2c5498b (diff) | |
download | tk-68ae9855a65a2bee4130a02c1a3f464aca9d7e3b.zip tk-68ae9855a65a2bee4130a02c1a3f464aca9d7e3b.tar.gz tk-68ae9855a65a2bee4130a02c1a3f464aca9d7e3b.tar.bz2 |
merge updates from HEAD
Diffstat (limited to 'generic/ttk/ttkLayout.c')
-rw-r--r-- | generic/ttk/ttkLayout.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index d604cfe..cd74ee5 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -5,7 +5,7 @@ * * Copyright (c) 2003 Joe English. Freely redistributable. * - * $Id: ttkLayout.c,v 1.8.2.1 2007/11/21 16:46:27 dgp Exp $ + * $Id: ttkLayout.c,v 1.8.2.2 2007/12/04 17:05:20 dgp Exp $ */ #include <string.h> @@ -722,7 +722,7 @@ Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec spec) { Ttk_TemplateNode *first = 0, *last = 0; - for ( ; !(spec->opcode & TTK_LAYOUT_END) ; ++spec) { + for ( ; !(spec->opcode & _TTK_LAYOUT_END) ; ++spec) { if (spec->elementName) { Ttk_TemplateNode *node = Ttk_NewTemplateNode(spec->elementName, spec->opcode); @@ -735,7 +735,7 @@ Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec spec) last = node; } - if (spec->opcode & TTK_CHILDREN) { + if (spec->opcode & _TTK_CHILDREN) { int depth = 1; last->child = Ttk_BuildLayoutTemplate(spec+1); @@ -743,19 +743,31 @@ Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec spec) */ while (depth) { ++spec; - if (spec->opcode & TTK_CHILDREN) { + if (spec->opcode & _TTK_CHILDREN) { ++depth; } - if (spec->opcode & TTK_LAYOUT_END) { + if (spec->opcode & _TTK_LAYOUT_END) { --depth; } } } + } /* for */ return first; } +void Ttk_RegisterLayouts(Ttk_Theme theme, Ttk_LayoutSpec spec) +{ + while (!(spec->opcode & _TTK_LAYOUT_END)) { + Ttk_LayoutTemplate layoutTemplate = Ttk_BuildLayoutTemplate(spec+1); + Ttk_RegisterLayoutTemplate(theme, spec->elementName, layoutTemplate); + do { + ++spec; + } while (!(spec->opcode & _TTK_LAYOUT)); + } +} + Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) { Tcl_Obj *result = Tcl_NewListObj(0,0); |