Index: doc/ttk_widget.n ================================================================== --- doc/ttk_widget.n +++ doc/ttk_widget.n @@ -343,52 +343,60 @@ .QW prelight (Gnome), .QW hot (Windows), .QW hover ). -.IP \fBdisabled\fR -Widget is disabled under program control (aka -.QW unavailable , -.QW inactive ). -.IP \fBfocus\fR -Widget has keyboard focus. -.IP \fBpressed\fR -Widget is being pressed (aka -.QW armed -in Motif). -.IP \fBselected\fR -.QW On , -.QW true , -or -.QW current -for things like checkbuttons and radiobuttons. -.IP \fBbackground\fR -Windows and the Mac have a notion of an -.QW active -or foreground window. -The \fBbackground\fR state is set for widgets in a background window, -and cleared for those in the foreground window. -.IP \fBreadonly\fR -Widget should not allow user modification. .IP \fBalternate\fR A widget-specific alternate display format. For example, used for checkbuttons and radiobuttons in the .QW tristate or .QW mixed state, and for buttons with \fB\-default active\fR. -.IP \fBinvalid\fR -The widget's value is invalid. -(Potential uses: scale widget value out of bounds, -entry widget value failed validation.) +.IP \fBbackground\fR +Windows and the Mac have a notion of an +.QW active +or foreground window. +The \fBbackground\fR state is set for widgets in a background window, +and cleared for those in the foreground window. +.IP \fBdisabled\fR +Widget is disabled under program control (aka +.QW unavailable , +.QW inactive ). +.IP \fBfirst\fR +Widget is the first one in a container. Used for tab elements in a notebook. +.IP \fBfocus\fR +Widget has keyboard focus. .IP \fBhover\fR The mouse cursor is within the widget. This is similar to the \fBactive\fP state; it is used in some themes for widgets that provide distinct visual feedback for the active widget in addition to the active element within the widget. +.IP \fBinvalid\fR +The widget's value is invalid. +(Potential uses: scale widget value out of bounds, +entry widget value failed validation.) +.IP \fBlast\fR +Widget is the last one in a container. Used for tab elements in a notebook. +.IP \fBleaf\fR +Widget is a leaf. Used in a treeview widget. +.IP \fBopen\fR +Widget is in the open state. Used in a treeview widget. +.IP \fBpressed\fR +Widget is being pressed (aka +.QW armed +in Motif). +.IP \fBreadonly\fR +Widget should not allow user modification. +.IP \fBselected\fR +.QW On , +.QW true , +or +.QW current +for things like checkbuttons and radiobuttons. .IP \fBuser1\fR-\fBuser6\fR Freely usable for other purposes .PP A \fIstate specification\fR or \fIstateSpec\fR is a list of state names, optionally prefixed with an exclamation point (!) Index: generic/ttk/ttkState.c ================================================================== --- generic/ttk/ttkState.c +++ generic/ttk/ttkState.c @@ -14,16 +14,20 @@ static const struct { char name[12]; int value; } stateNames[] = { {"active", TTK_STATE_ACTIVE}, /* Mouse cursor is over widget or element */ - {"alternate", TTK_STATE_ALTERNATE}, /* Widget-specific alternate display style */ + {"alternate", TTK_STATE_ALTERNATE}, /* Widget-specific alternate display style */ {"background", TTK_STATE_BACKGROUND}, /* Top-level window lost focus (Mac,Win "inactive") */ {"disabled", TTK_STATE_DISABLED}, /* Widget is disabled */ - {"focus", TTK_STATE_FOCUS}, /* Widget has keyboard focus */ - {"hover", TTK_STATE_HOVER}, /* Mouse cursor is over widget */ + {"first", TTK_STATE_FIRST}, /* First */ + {"focus", TTK_STATE_FOCUS}, /* Widget has keyboard focus */ + {"hover", TTK_STATE_HOVER}, /* Mouse cursor is over widget */ {"invalid", TTK_STATE_INVALID}, /* Bad value */ + {"last", TTK_STATE_LAST}, /* Last */ + {"leaf", TTK_STATE_LEAF}, /* Leaf */ + {"open", TTK_STATE_OPEN}, /* Open */ {"pressed", TTK_STATE_PRESSED}, /* Pressed or "armed" */ {"readonly", TTK_STATE_READONLY}, /* Editing/modification disabled */ {"selected", TTK_STATE_SELECTED}, /* "on", "true", "current", etc. */ {"user1", TTK_STATE_USER1}, /* User-definable state */ {"user2", TTK_STATE_USER2}, /* User-definable state */ Index: generic/ttk/ttkTheme.h ================================================================== --- generic/ttk/ttkTheme.h +++ generic/ttk/ttkTheme.h @@ -57,10 +57,14 @@ #define TTK_STATE_USER5 (1<<11) #define TTK_STATE_USER4 (1<<12) #define TTK_STATE_USER3 (1<<13) #define TTK_STATE_USER2 (1<<14) #define TTK_STATE_USER1 (1<<15) +#define TTK_STATE_OPEN (1<<16) +#define TTK_STATE_LEAF (1<<17) +#define TTK_STATE_FIRST (1<<18) +#define TTK_STATE_LAST (1<<19) /* Maintenance note: if you get all the way to "USER1", * see tkstate.c */ typedef struct Index: generic/ttk/ttkThemeInt.h ================================================================== --- generic/ttk/ttkThemeInt.h +++ generic/ttk/ttkThemeInt.h @@ -7,19 +7,10 @@ #ifndef _TTKTHEMEINT #define _TTKTHEMEINT #include "ttkTheme.h" -/*------------------------------------------------------------------------ - * +++ Widget states (internal). - */ - -#define TTK_STATE_OPEN (1<<16) -#define TTK_STATE_LEAF (1<<17) -#define TTK_STATE_FIRST (1<<18) -#define TTK_STATE_LAST (1<<19) - typedef struct Ttk_TemplateNode_ Ttk_TemplateNode, *Ttk_LayoutTemplate; MODULE_SCOPE Ttk_ElementClass *Ttk_GetElement(Ttk_Theme, const char *name); MODULE_SCOPE const char *Ttk_ElementClassName(Ttk_ElementClass *);