Tk Source Code

Changes On Branch rfe-d632d28ba4
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch rfe-d632d28ba4 Excluding Merge-Ins

This is equivalent to a diff from c9ebf2f9 to 329a55be

2025-05-15
09:28
TIP #719: Add new states to make images of ttk::treeview and ttk::notebook customable check-in: c8727dda user: jan.nijtmans tags: trunk, main
2025-05-07
19:41
Fix code alignment. Closed-Leaf check-in: 329a55be user: fvogel tags: rfe-d632d28ba4
2025-02-06
22:04
Update documentation check-in: 869cff8a user: jan.nijtmans tags: rfe-d632d28ba4
17:51
Solution for RFE [9902d8fc8e]: No grip element in ttk::panedwindow sashes of most built-in themes. check-in: adc0ea73 user: csaba tags: trunk, main
2025-02-04
10:58
Export "open"/"leaf"/"first"/"last" ttk state values at script level check-in: 7d1b122e user: jan.nijtmans tags: rfe-d632d28ba4
2025-02-03
18:12
Create new branch named "bug-9902d8fc8e" check-in: be8add90 user: csaba tags: bug-9902d8fc8e
2025-01-30
10:33
Merge 9.0 check-in: 19efdada user: jan.nijtmans tags: tip-626
10:27
It appears that not all testcases are adapted for macos-15 yet, so for now use macos-14 check-in: dad7de1d user: jan.nijtmans tags: core-8-6-branch
2025-01-29
12:57
It appears that not all testcases are adapted for macos-15 yet, so for now use macos-14 check-in: c9ebf2f9 user: jan.nijtmans tags: trunk, main
2025-01-28
20:16
Additional branches should not be added to CI .yml files (please!) check-in: 4426d73c user: jan.nijtmans tags: trunk, main

Changes to doc/ttk_widget.n.
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378






379
380



381

382
383
384
385
386
387
388
389






















390
391
392
393
394
395
396
The mouse cursor is over the widget
and pressing a mouse button will cause some action to occur. (aka
.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 \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 \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 (!)
indicating that the bit is off.
.SH EXAMPLES







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







>
>
>
>
>
>
|
|
>
>
>
|
>
|







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







341
342
343
344
345
346
347
























348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
The mouse cursor is over the widget
and pressing a mouse button will cause some action to occur. (aka
.QW prelight
(Gnome),
.QW hot
(Windows),
.QW hover ).
























.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 \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 (!)
indicating that the bit is off.
.SH EXAMPLES
Changes to generic/ttk/ttkState.c.
12
13
14
15
16
17
18
19
20
21

22
23
24



25
26
27
28
29
30
31
 * Table of state names.
 */
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 */
    {"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 */
    {"invalid", TTK_STATE_INVALID},		/* Bad value */



    {"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 */
    {"user3", TTK_STATE_USER3},		/* User-definable state */
    {"user4", TTK_STATE_USER4},		/* User-definable state */







|


>
|
|

>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * Table of state names.
 */
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 */
    {"background", TTK_STATE_BACKGROUND},	/* Top-level window lost focus (Mac,Win "inactive") */
    {"disabled", TTK_STATE_DISABLED},		/* Widget is disabled */
    {"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 */
    {"user3", TTK_STATE_USER3},		/* User-definable state */
    {"user4", TTK_STATE_USER4},		/* User-definable state */
Changes to generic/ttk/ttkTheme.h.
55
56
57
58
59
60
61




62
63
64
65
66
67
68
#define TTK_STATE_HOVER		(1<<9)
#define TTK_STATE_USER6		(1<<10)
#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)





/* Maintenance note: if you get all the way to "USER1",
 * see tkstate.c
 */
typedef struct
{
    unsigned int onbits;	/* bits to turn on */







>
>
>
>







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#define TTK_STATE_HOVER		(1<<9)
#define TTK_STATE_USER6		(1<<10)
#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
{
    unsigned int onbits;	/* bits to turn on */
Changes to generic/ttk/ttkThemeInt.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Theme engine: private definitions.
 *
 * Copyright © 2004 Joe English.  Freely redistributable.
 */

#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 *);

MODULE_SCOPE void Ttk_ElementSize(
	Ttk_ElementClass *, Ttk_Style, void *recordPtr, Tk_OptionTable,











<
<
<
<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11









12
13
14
15
16
17
18
/*
 * Theme engine: private definitions.
 *
 * Copyright © 2004 Joe English.  Freely redistributable.
 */

#ifndef _TTKTHEMEINT
#define _TTKTHEMEINT

#include "ttkTheme.h"










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 *);

MODULE_SCOPE void Ttk_ElementSize(
	Ttk_ElementClass *, Ttk_Style, void *recordPtr, Tk_OptionTable,