home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / windows / x / 14448 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.7 KB  |  47 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!organ!ware
  3. From: ware@organ.cis.ohio-state.edu (Peter Ware)
  4. Subject: Re: Can Primitive widgets be parents?
  5. In-Reply-To: whe@usc.edu's message of 26 Jul 1992 01: 00:49 -0700
  6. Message-ID: <WARE.92Jul27154037@organ.cis.ohio-state.edu>
  7. Originator: ware@organ.cis.ohio-state.edu
  8. Sender: news@cis.ohio-state.edu (NETnews        )
  9. Organization: Ohio State Computer Science
  10. References: <l74mthINN5q4@phakt.usc.edu>
  11. Date: Mon, 27 Jul 1992 20:40:37 GMT
  12. Lines: 33
  13.  
  14. > Can Primitive widgets be parents?
  15. Any widget can have as many popup children as desired -- it is
  16. primarily a conveniant method of getting properly qualified resource
  17. names.
  18.  
  19. Also, as long as it is never managed a Primitive widget can have
  20. children created with XtCreateWidget().  For most applications this is
  21. not a useful thing although it is not unreasonable for a widget to
  22. create other widgets this way.
  23.  
  24. > And in the same page, they create two buttons, but with same widget name
  25. > "button":
  26. >
  27. > Widget button;
  28. >
  29. > button = XtVaCreateManagedWidget("PushMe-1", xmPushButtonWidgetClass, parent,
  30. >            NULL);
  31. > button = XtVaCreateManagedWidget("PushMe-2", xmPushButtonWidgetClass, parent
  32. >            NULL);
  33.  
  34. This is because the application does nothing further with the "button"
  35. widget.  It would have been just as valid (ignoring error checking) to
  36. write:
  37.  
  38.     (void) XtVaCreateManagedWidget("PushMe-1", xmPushButtonWidgetClass,
  39.                     parent, NULL);
  40.  
  41. and discard the return value.
  42. --
  43. Pete Ware / Ohio State University /
  44.            ware@cis.ohio-state.edu
  45.            (614) 538-0965
  46. Too bad the Nike slogan isn't "Just Do It Right" instead of "Just Do It"
  47.