Path: utzoo!attcan!uunet!sps!arm From: arm@sps.com (Annette Myjak) Newsgroups: comp.windows.x.motif Subject: Toggle Button Woes Message-ID: <270@sps.com> Date: 13 Sep 90 16:49:52 GMT Organization: SPS - Indialantic, FL Lines: 53 i'm at a bit of a loss to explain the following behavior for a toggle button. if anyone could enlighten me, i'd be most appreciative. i want to add a toggle button to a standard selection box dialog. (the documentation says i can add one child to the work area of a selection box dialog.) i usually use UIL, so i created my selection box in the usual UIL manner. however, i have to add the toggle button AFTER the selection box is created. so i have a function that fetches the selection box from the UID hierarchy and creates it, and then uses the standard (non UIL) stuff to create the toggle button and add it to the selection box. (ie, use XtSetArg to put some resources and their values into an array, use XmCreateToggleButton with the parent being the selection box and passing the argument array, use XtAddCallback to register a XmNvalueChangedCallback, and XtManage my toggle button widget.) so far so good. the toggle button is there, and the procedure for the XmNvalueChangedCallback is getting executed. now the strange stuff. when i added the callback, i used: XtAddCallback (toggle, XmNvalueChangedCallback, procedure, global_val); where the global_val is just an integer constant to be used in the procedure as a switch value. (in this case, 71) however, in my procedure, the value that's getting passed in is a 0 instead of the number it's supposed to be (71). so, like, what happened? i have several toggle buttons on another form widget that also use this same procedure for their XmNvalueChangedCallback's, and they all pass in the proper constant values to use for the switch value. (this other widget with it's toggle buttons are completely defined in UIL). for the selection box dialog, i finally used the value of the widget passed to the procedure by the callback function as a switch value to do what i needed to do. in short, i managed to get something to work, but i still can't figure out why the client_data that got passed to the procedure from the callback is showing up as 0 instead of 71. anybody got any clues? thanks, annette myjak arm@sps.com