Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!bierstat.scd.ucar.edu!morreale From: morreale@bierstadt.scd.ucar.edu (Peter Morreale) Newsgroups: comp.windows.x Subject: Xt toggle widget problem... Keywords: Xt toggle, policy problem Message-ID: <11264@ncar.ucar.edu> Date: 2 May 91 20:15:52 GMT Sender: news@ncar.ucar.edu Reply-To: morreale@bierstadt.scd.ucar.edu (Peter Morreale) Organization: Scientific Computing Division / NCAR, Boulder Co. Lines: 64 I need some help from a kind Xt programmer out there..... I'm trying to implment a "zero, or one of many" policy on 3 toggle widgets. The toggles work, except that I can get "many" set. :-( I must have only zero or one toggle set. I previously implemented this as a "one of many" policy which worked fine. Now I need to force the user to choose one and only one. What happens with the code below is that I can set one toggle, then set another toggle *without* the previous toggle being unset. Here is the relevent code. What am I doing wrong? Thanks for any and all help... XtTranslations RadioTranslations, ContactTranslations; String TransTable2 = ": highlight(Always)\n\ : unhighlight()\n\ ,: toggle() notify()"; /* * First three toggles to tell what kind of contact */ ContactTranslations = XtParseTranslationTable(TransTable2); n = 0; XtSetArg(arg[n], XtNhorizDistance, 10); ++n; XtSetArg(arg[n], XtNfromVert, NULL); ++n; XtSetArg(arg[n], XtNleft, XtChainLeft); ++n; XtSetArg(arg[n], XtNright, XtChainLeft); ++n; XtSetArg(arg[n], XtNtop, XtChainTop); ++n; XtSetArg(arg[n], XtNbottom, XtChainTop); ++n; XtSetArg(arg[n], XtNtranslations, ContactTranslations); ++n; XtSetArg(arg[7], XtNfromHoriz, NULL); XtSetArg(arg[8], XtNradioData, contact[0]); Type_Phone = XtCreateManagedWidget("phone", toggleWidgetClass, Contacts, arg, 8); XtSetArg(arg[7], XtNfromHoriz, Type_Phone); XtSetArg(arg[8], XtNradioData, contact[1]); XtSetArg(arg[9], XtNradioGroup, Type_Phone); Type_Mail = XtCreateManagedWidget("mail", toggleWidgetClass, Contacts, arg, 9); XtSetArg(arg[7], XtNfromHoriz, Type_Mail); XtSetArg(arg[8], XtNradioData, contact[2]); XtSetArg(arg[9], XtNradioGroup, Type_Mail); Type_Walkin = XtCreateManagedWidget("walkin", toggleWidgetClass, Contacts, arg, 9); -PWM ------------------------------------------------------------------ Peter W. Morreale email: morreale@ncar.ucar.edu Nat'l Center for Atmos Research voice: (303) 497-1293 Scientific Computing Division Consulting Office ------------------------------------------------------------------