Tk Source Code

Check-in [52e5bdba]
Login

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

Overview
Comment:Minor cleanup
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tka11y
Files: files | file ages | folders
SHA3-256: 52e5bdbaca2e3099a1c94c1b00f32704d6c4da6cc1eeca63c964e4b1096e187c
User & Date: kevin_walzer 2025-06-25 17:56:20.756
Context
2025-06-26
03:59
Substantial attempt to track non-root toplevels and their child widgets in the accessibility hierarchy check-in: f5796a3e user: kevin_walzer tags: tka11y
2025-06-25
17:56
Minor cleanup check-in: 52e5bdba user: kevin_walzer tags: tka11y
2025-06-24
01:00
Merge trunk check-in: 74e65c6d user: kevin_walzer tags: tka11y
Changes
Unified Diff Ignore Whitespace Patch
Changes to library/accessibility.tcl.
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
					       Notebook \
					       [%W tab current -text] \
					       {} \
					       {}\
					   }

    # Activate accessibility object when mapped.
    if {[tk windowingsystem] eq "win32"} {
	#MSAA objects need to be created before the map event.
	bind all <Configure> {
	    if {[winfo exists %W] && [winfo ismapped %W]} {
		::tk::accessible::add_acc_object %W
	    }
	}
    } else {
	bind all <Map> {+::tk::accessible::add_acc_object %W}
    }

    # Various bindings to capture data/selection changes for
    # widgets that support returning a value. 

    #Selection changes.
    bind Listbox <<ListboxSelect>> {+::tk::accessible::_updateselection %W} 
    bind Treeview <<TreeviewSelect>> {+::tk::accessible::_updateselection %W}
    bind TCombobox <<ComboboxSelected>> {+::tk::accessible::_updateselection %W}







<
<
<
<
<
<
<
<

|
<







554
555
556
557
558
559
560








561
562

563
564
565
566
567
568
569
					       Notebook \
					       [%W tab current -text] \
					       {} \
					       {}\
					   }

    # Activate accessibility object when mapped.








	bind all <Map> {+::tk::accessible::add_acc_object %W}
  

    # Various bindings to capture data/selection changes for
    # widgets that support returning a value. 

    #Selection changes.
    bind Listbox <<ListboxSelect>> {+::tk::accessible::_updateselection %W} 
    bind Treeview <<TreeviewSelect>> {+::tk::accessible::_updateselection %W}
    bind TCombobox <<ComboboxSelected>> {+::tk::accessible::_updateselection %W}
Changes to win/tkWinAccessibility.c.
1178
1179
1180
1181
1182
1183
1184

1185
1186
1187


1188
1189
1190
1191
1192
1193
1194
 *
 *----------------------------------------------------------------------
 */

/* Function to map Tk window to MSAA attributes. */
static TkRootAccessible *CreateRootAccessible(Tcl_Interp *interp, HWND hwnd, const char *pathName)
{

    TkRootAccessible *tkAccessible = (TkRootAccessible *)ckalloc(sizeof(TkRootAccessible));
  
    Tk_Window win = Tk_NameToWindow(interp, pathName, Tk_MainWindow(interp));


    if (tkAccessible) {
	tkAccessible->lpVtbl = &tkRootAccessibleVtbl;
	tkAccessible->interp = interp;
	tkAccessible->hwnd = hwnd;
	tkAccessible->pathName = pathName;
	tkAccessible->refCount = 1;
	tkAccessible->win = win;







>



>
>







1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
 *
 *----------------------------------------------------------------------
 */

/* Function to map Tk window to MSAA attributes. */
static TkRootAccessible *CreateRootAccessible(Tcl_Interp *interp, HWND hwnd, const char *pathName)
{
	
    TkRootAccessible *tkAccessible = (TkRootAccessible *)ckalloc(sizeof(TkRootAccessible));
  
    Tk_Window win = Tk_NameToWindow(interp, pathName, Tk_MainWindow(interp));
	Tk_MakeWindowExist(win);
	
    if (tkAccessible) {
	tkAccessible->lpVtbl = &tkRootAccessibleVtbl;
	tkAccessible->interp = interp;
	tkAccessible->hwnd = hwnd;
	tkAccessible->pathName = pathName;
	tkAccessible->refCount = 1;
	tkAccessible->win = win;
1705
1706
1707
1708
1709
1710
1711

1712
1713
1714
1715
1716
1717
1718
    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "window");
	return TCL_ERROR;
    }

    char *windowName = Tcl_GetString(objv[1]);
    Tk_Window tkwin = Tk_NameToWindow(interp, windowName, Tk_MainWindow(interp));


    if (tkwin == NULL) {
	Tcl_SetResult(interp, "Invalid window name.", TCL_STATIC);
	return TCL_ERROR;
    }
  
    if (Tk_IsTopLevel(tkwin)) { 







>







1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "window");
	return TCL_ERROR;
    }

    char *windowName = Tcl_GetString(objv[1]);
    Tk_Window tkwin = Tk_NameToWindow(interp, windowName, Tk_MainWindow(interp));
	Tk_MakeWindowExist(tkwin);

    if (tkwin == NULL) {
	Tcl_SetResult(interp, "Invalid window name.", TCL_STATIC);
	return TCL_ERROR;
    }
  
    if (Tk_IsTopLevel(tkwin)) {