home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / fj / maillis / xwindow / 17597 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  3.4 KB

  1. Path: sparky!uunet!stanford.edu!agate!netsys!pagesat!a2i!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
  2. From: gangrene!rread@seq.csuhayward.edu (robert m read)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: RadioGroups in Aw ??
  5. Message-ID: <1992Nov18.213030.7615@sm.sony.co.jp>
  6. Date: 18 Nov 92 21:30:30 GMT
  7. Sender: daemon@sm.sony.co.jp (The devil himself)
  8. Distribution: fj
  9. Organization: Workstation Div., Supermicro Systems Group, Sony Corporation
  10. Lines: 75
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Tue, 17 Nov 1992 17:20:28 -0800 (PST)
  14. In-Reply-To: <1992Nov17.095011.29951@daimi.aau.dk> from "Peter Andersen" at Nov 17, 92 09:50:11 am
  15. Include: <stdio.h>
  16. X-Mailer: ELM [version 2.4 PL3]
  17. Content-Type: text
  18. Content-Length: 2641      
  19. Message-Id:  <9211171720.aa02496@morbus.diogenes.UUCP>
  20.  
  21. > I have tried using the Toggles of the Athena widgets (X11R4).
  22. > I want to use them for a radio panel.
  23. > I have created 5 Toggles t1, t2, t3, t4, and t5, that I connect
  24. > in the following way:
  25. >     XtSetArg(arg, XtNradioGroup, t1);
  26. >     XtSetValues(t2, arg, 1);
  27. >     XtSetArg(arg, XtNradioGroup, t2);
  28. >     XtSetValues(t1, arg, 1);
  29. >     XtSetArg(arg, XtNradioGroup, t2);
  30. >     XtSetValues(t3, arg, 1);
  31. >     XtSetArg(arg, XtNradioGroup, t3);
  32. >     XtSetValues(t4, arg, 1);
  33. >     XtSetArg(arg, XtNradioGroup, t4);
  34. >     XtSetValues(t5, arg, 1);
  35.    
  36. When I compiled and ran your sample program, it dumped core. I did
  37. not investiate why. I tried using the following, though, it worked
  38. There are other variations that also work, and there are many
  39. more that do not.             
  40.  
  41.    /* Try this. */
  42.    XawToggleChangeRadioGroup(t1, t1); /* could also use (t1, t2) here */
  43.    XawToggleChangeRadioGroup(t2, t1);
  44.    XawToggleChangeRadioGroup(t3, t1);
  45.    XawToggleChangeRadioGroup(t4, t1);
  46.    XawToggleChangeRadioGroup(t5, t1);
  47.                              
  48. The first call can also have these arguments (t1, t2) and the code
  49. will also work. This is what I figure is going on. The first call
  50. creates a new radio group, and puts t1 on it. (Actually, the
  51. radioGroup resource in t1 is set to point to t2.) The second one
  52. puts t2 on the radio group that t1 is on. The third, well you get
  53. the idea. The reason that the following will not work is a little
  54. subtle.
  55.  
  56.   XawToggleChangeRadioGroup(t1, t2);
  57.                ''          (t2, t3);
  58.            ''          (t3, t4);
  59.            ''          (t4, t5);
  60.            ''          (t5, t1);
  61.  
  62. The first call creates a new group and puts t1 on it. The second
  63. call creates a new group and puts t2 on it, and so on down to the
  64. last line. Here, t5 is placed on t1's group, and when you run this
  65. example, t1 and t5 are the only toggles that work as a radio group.
  66. Sure, t1 points to t2, but t2 thinks it is part of t3's radio
  67. group. This, to me, impies a circular relationship.
  68.  
  69. I'll bet this is one case in which looking at the implementation
  70. would help us comprehend exactly what's going on. It looks, though,
  71. like a radio group is actually a doubly linked, *circualar* list.
  72. Perhaps someone else can give us some more details on that.
  73. (I don't have the source, and I don't feel like going out on
  74. to the net to get right now--it's dinner time.)
  75.  
  76. -- 
  77. rm read
  78. Software Engineer, CyberTigger International
  79. internet: rread%gangrene.uucp@mcs.csuhayward.
  80.  
  81. \\       Weave a circle round him thrice,
  82.  \\        And close your eyes with holy dread,
  83.  //        For he on honey dew hath fed,
  84. //       And drunk the milk of Paradise.             
  85.