SetPane.c 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright Massachusetts Institute of Technology 1985 */
  2. #include "copyright.h"
  3. /*
  4. * XMenu: MIT Project Athena, X Window system menu package
  5. *
  6. * XMenuSetPane - Set a menu pane to be active or inactive.
  7. *
  8. * Author: Tony Della Fera, DEC
  9. * August, 1985
  10. *
  11. */
  12. #include "XMenuInt.h"
  13. int
  14. XMenuSetPane(register XMenu *menu, register int p_num, register int active)
  15. /* Menu object to be modified. */
  16. /* Pane number to be modified. */
  17. /* Make selection active? */
  18. {
  19. register XMPane *p_ptr; /* XMPane pointer. */
  20. /*
  21. * Find the right pane.
  22. */
  23. p_ptr = _XMGetPanePtr(menu, p_num);
  24. if (p_ptr == NULL) return(XM_FAILURE);
  25. /*
  26. * Set its active switch.
  27. */
  28. p_ptr->active = active;
  29. if (p_ptr->active == False) p_ptr->activated = False;
  30. /*
  31. * Return the pane number just set.
  32. */
  33. _XMErrorCode = XME_NO_ERROR;
  34. return(p_num);
  35. }