home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!netsys!pagesat!a2i!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
- From: gangrene!rread@seq.csuhayward.edu (robert m read)
- Newsgroups: fj.mail-lists.x-window
- Subject: Re: RadioGroups in Aw ??
- Message-ID: <1992Nov18.213030.7615@sm.sony.co.jp>
- Date: 18 Nov 92 21:30:30 GMT
- Sender: daemon@sm.sony.co.jp (The devil himself)
- Distribution: fj
- Organization: Workstation Div., Supermicro Systems Group, Sony Corporation
- Lines: 75
- Approved: michael@sm.sony.co.jp
-
- Date: Tue, 17 Nov 1992 17:20:28 -0800 (PST)
- In-Reply-To: <1992Nov17.095011.29951@daimi.aau.dk> from "Peter Andersen" at Nov 17, 92 09:50:11 am
- Include: <stdio.h>
- X-Mailer: ELM [version 2.4 PL3]
- Content-Type: text
- Content-Length: 2641
- Message-Id: <9211171720.aa02496@morbus.diogenes.UUCP>
-
- >
- > I have tried using the Toggles of the Athena widgets (X11R4).
- > I want to use them for a radio panel.
- > I have created 5 Toggles t1, t2, t3, t4, and t5, that I connect
- > in the following way:
- >
- > XtSetArg(arg, XtNradioGroup, t1);
- > XtSetValues(t2, arg, 1);
- > XtSetArg(arg, XtNradioGroup, t2);
- > XtSetValues(t1, arg, 1);
- > XtSetArg(arg, XtNradioGroup, t2);
- > XtSetValues(t3, arg, 1);
- > XtSetArg(arg, XtNradioGroup, t3);
- > XtSetValues(t4, arg, 1);
- > XtSetArg(arg, XtNradioGroup, t4);
- > XtSetValues(t5, arg, 1);
- >
-
- When I compiled and ran your sample program, it dumped core. I did
- not investiate why. I tried using the following, though, it worked
- There are other variations that also work, and there are many
- more that do not.
-
- /* Try this. */
- XawToggleChangeRadioGroup(t1, t1); /* could also use (t1, t2) here */
- XawToggleChangeRadioGroup(t2, t1);
- XawToggleChangeRadioGroup(t3, t1);
- XawToggleChangeRadioGroup(t4, t1);
- XawToggleChangeRadioGroup(t5, t1);
-
- The first call can also have these arguments (t1, t2) and the code
- will also work. This is what I figure is going on. The first call
- creates a new radio group, and puts t1 on it. (Actually, the
- radioGroup resource in t1 is set to point to t2.) The second one
- puts t2 on the radio group that t1 is on. The third, well you get
- the idea. The reason that the following will not work is a little
- subtle.
-
- XawToggleChangeRadioGroup(t1, t2);
- '' (t2, t3);
- '' (t3, t4);
- '' (t4, t5);
- '' (t5, t1);
-
- The first call creates a new group and puts t1 on it. The second
- call creates a new group and puts t2 on it, and so on down to the
- last line. Here, t5 is placed on t1's group, and when you run this
- example, t1 and t5 are the only toggles that work as a radio group.
- Sure, t1 points to t2, but t2 thinks it is part of t3's radio
- group. This, to me, impies a circular relationship.
-
- I'll bet this is one case in which looking at the implementation
- would help us comprehend exactly what's going on. It looks, though,
- like a radio group is actually a doubly linked, *circualar* list.
- Perhaps someone else can give us some more details on that.
- (I don't have the source, and I don't feel like going out on
- to the net to get right now--it's dinner time.)
-
- --
- rm read
- Software Engineer, CyberTigger International
- internet: rread%gangrene.uucp@mcs.csuhayward.
-
- \\ Weave a circle round him thrice,
- \\ And close your eyes with holy dread,
- // For he on honey dew hath fed,
- // And drunk the milk of Paradise.
-