Xref: utzoo alt.toolkits.xview:228 comp.windows.open-look:1808 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!infonode!ingr!supergas!naftaly From: naftaly@dazixco.ingr.com (Naftaly Stramer) Newsgroups: alt.toolkits.xview,comp.windows.open-look Subject: Re: problem attaching XV_KEY_DATA to panel Message-ID: <1991Jun27.233530.18565@ingr.ingr.com> Date: 27 Jun 91 23:35:30 GMT References: <1991Jun27.221718.18172@leland.Stanford.EDU> Sender: naftaly@supergas (Naftaly Stramer) Organization: Intergraph Corp., Huntsville, AL Lines: 58 In article <1991Jun27.221718.18172@leland.Stanford.EDU>, erose@hydro.Stanford.EDU (Eric Rose) writes: |> |> |> I seem to have found a problem storing a pointer with a Panel using |> XV_KEY_DATA. The manual does not explicitly state that this is possible |> for all xview objects, but then again is does not give any reason why |> this is not possible. |> |> I am running xview 2.0 (I think) under openwin 2.0 on a Sparc 2, SunOS 4.1.1 |> |> The code prints the string correctly while in main, but in the button callback |> prints garbage for the string. |> |> ------------------------------------------------------------------------------- If you attach the XV_KEY_DATA to the button it will work. panel = (Panel)xv_create(frame, PANEL, NULL); printf("The string still is: \"%s\"\n",string); xv_create(panel, PANEL_BUTTON, PANEL_LABEL_STRING, "Verify & Quit", PANEL_NOTIFY_PROC, button_cb, XV_KEY_DATA, 1, string, NULL); xv_main_loop(frame); exit(0); } void button_cb(item,event) Panel_item item; Event *event; { printf("The string now is \"%s\"\n",(char*)xv_get(item,XV_KEY_DATA,1)); xv_destroy_safe(frame); } -- Naftaly Stramer (303)581-1477 DAZIX, An Intergraph Company Internet: naftaly@dazixco.ingr.com 6285 Lookout Road UUCP: ..uunet!ingr!dazixco!naftaly Boulder, CO 80301 Please excuse my english -- Naftaly Stramer (303)581-1477 DAZIX, An Intergraph Company Internet: naftaly@dazixco.ingr.com 6285 Lookout Road UUCP: ..uunet!ingr!dazixco!naftaly Boulder, CO 80301 Please excuse my english