Posted to tcl by kevin_walzer at Sun Jan 26 04:07:44 GMT 2025view raw

  1. /*
  2. *----------------------------------------------------------------------
  3. *
  4. * Tk_GetAccessibleDescription --
  5. *
  6. * This function reads a platform-neutral accessibility descrption for a
  7. * specific widget.
  8. *
  9. *
  10. * Results:
  11. * Assigns an accessibility description.
  12. *
  13. * Side effects:
  14. * None.
  15. *
  16. *----------------------------------------------------------------------
  17. */
  18. int
  19. Tk_GetAccessibleDescription(
  20. TCL_UNUSED(void *),
  21. Tcl_Interp *ip, /* Current interpreter. */
  22. int objc, /* Number of arguments. */
  23. Tcl_Obj *const objv[]) /* Argument objects. */
  24. {
  25. if (objc < 2) {
  26. Tcl_WrongNumArgs(ip, 1, objv, "window?");
  27. return TCL_ERROR;
  28. }
  29. Tk_Window win;
  30. Tcl_HashEntry *hPtr, *hPtr2;
  31. Tcl_HashTable *AccessibleAttributes;
  32. win = Tk_NameToWindow(ip, Tcl_GetString(objv[1]), Tk_MainWindow(ip));
  33. if (win == NULL) {
  34. return TCL_ERROR;
  35. }
  36. /* Get accessible description for window. */
  37. hPtr=Tcl_FindHashEntry(TkAccessibilityObject, win);
  38. if (!hPtr) {
  39. Tcl_AppendResult(ip, "No table found. You must set the accessibility role first.", (char *) NULL);
  40. return TCL_ERROR;
  41. }
  42. AccessibleAttributes = Tcl_GetHashValue(hPtr);
  43. hPtr2=Tcl_FindHashEntry(AccessibleAttributes, "description");
  44. if (!hPtr2) {
  45. Tcl_AppendResult(ip, "No description found", (char *) NULL);
  46. return TCL_ERROR;
  47. }
  48. Tcl_SetObjResult(ip, Tcl_GetHashValue(hPtr2));
  49. return TCL_OK;
  50. }

AltStyle によって変換されたページ (->オリジナル) /