/*------------------------------------------------------------------------ * +++ Layout management hooks. */ static Ttk_Layout PanedGetLayout( Tcl_Interp *interp, Ttk_Theme themePtr, void *recordPtr) { Paned *pw = recordPtr; Ttk_Layout panedLayout = TtkWidgetGetLayout(interp, themePtr, recordPtr); if (panedLayout) { int horizontal = pw->paned.orient == TTK_ORIENT_HORIZONTAL; const char *layoutName = horizontal ? ".Vertical.Sash" : ".Horizontal.Sash"; Ttk_Layout sashLayout = Ttk_CreateSublayout( interp, themePtr, panedLayout, layoutName, pw->core.optionTable); if (sashLayout) { int sashWidth, sashHeight; Ttk_LayoutSize(sashLayout, 0, &sashWidth, &sashHeight); pw->paned.sashThickness = horizontal ? sashWidth : sashHeight; if (pw->paned.sashLayout) Ttk_FreeLayout(pw->paned.sashLayout); pw->paned.sashLayout = sashLayout; } else { Ttk_FreeLayout(panedLayout); return 0; } } return panedLayout; }
/* LabelframeCleanup -- * Cleanup hook. */ static void LabelframeCleanup(void *recordPtr) { Labelframe *lframe = recordPtr; Ttk_DeleteManager(lframe->label.mgr); if (lframe->label.labelLayout) { Ttk_FreeLayout(lframe->label.labelLayout); } }
static void PanedCleanup(void *recordPtr) { Paned *pw = recordPtr; if (pw->paned.sashLayout) Ttk_FreeLayout(pw->paned.sashLayout); Tk_DeleteEventHandler(pw->core.tkwin, PanedEventMask, PanedEventProc, recordPtr); Ttk_DeleteManager(pw->paned.mgr); }
static Ttk_Layout LabelframeGetLayout( Tcl_Interp *interp, Ttk_Theme theme, void *recordPtr) { Labelframe *lf = recordPtr; Ttk_Layout frameLayout = TtkWidgetGetLayout(interp, theme, recordPtr); Ttk_Layout labelLayout; if (!frameLayout) { return NULL; } labelLayout = Ttk_CreateSublayout( interp, theme, frameLayout, ".Label", lf->core.optionTable); if (labelLayout) { if (lf->label.labelLayout) { Ttk_FreeLayout(lf->label.labelLayout); } Ttk_RebindSublayout(labelLayout, recordPtr); lf->label.labelLayout = labelLayout; } return frameLayout; }