Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!deimos.cis.ksu.edu!uxc!csd4.milw.wisc.edu!leah!albanycs!crdgw1!uunet!mcvax!unido!ztivax!tumuc!lan!stumpf From: stumpf@lan.informatik.tu-muenchen.dbp.de (Maex) Newsgroups: comp.windows.x Subject: question: XToolkit - callbacks Message-ID: <599@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Date: 15 Jun 89 14:13:16 GMT Sender: news@lan.informatik.tu-muenchen.dbp.de Reply-To: stumpf@lan.informatik.tu-muenchen.dbp.de (Maex) Organization: Inst. fuer Informatik, TU Muenchen, W. Germany Lines: 56 Hello, it's me again! This time I have a problem on callbacks! Currently I'm creating a "confirm" widget, which looks like this: +-------------------------------+ | | | (any message) | | | | +-------+ +-------+ | | | butt1 | | butt2 | | | +-------+ +-------+ | | | +-------------------------------+ (any message) is a labelWidget butt1, butt2 are commandWidgets My widget supports XtNcallback. I have a callback routine ButtonPress() which I add to the callback list of butt1 and butt2 and which gets in the client_data 0 or 1, depending on which button was clicked. This value (o or 1) I'd like to put in the client_data field of "my" callback. My problem is, that when ButtonPress() is called, I only get the WidgetId of the commandWidget the button was pressed in, but not the WidgetId of "my" widget. Currently ButtonPress looks like this: static void ButtonPress(w, cl_data, ca_data) Widget w; caddr_t cl_data, ca_data; { XtCallCallbacks(XtParent(w), XtNcallback, cl_data); } Is this correct, or is there a better solution, to call "my" callback list. (The above works correctly for me, but I don't know, whether this is good behaviour) Thanks \Maex +------------------------------------------------------------------------------+ | Markus Stumpf | | TU Muenchen local: lan.informatik.tu-muenchen.dbp.de | | Inst. f. Informatik DFN: stumpf@{local} | | Arcisstrasse UUCP: stumpf%{local}@unido.uucp | | D-8000 Muenchen ARPA/CS: stumpf%{local}@relay.cs.net | | West Germany BITNET: infrza02@dm0tui1s.bitnet | +------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ | Markus Stumpf | | TU Muenchen local: lan.informatik.tu-muenchen.dbp.de | | Inst. f. Informatik DFN: stumpf@{local} |