summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkLayout.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/ttk/ttkLayout.c')
-rw-r--r--generic/ttk/ttkLayout.c22
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);