Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!emory!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!bofin!cjmchale From: cjmchale@cs.tcd.ie (Ciaran McHale) Newsgroups: comp.windows.x Subject: Re: Cursor implementation Message-ID: <1991Apr17.201549.28248@cs.tcd.ie> Date: 17 Apr 91 20:15:49 GMT References: <9103251415.AA26899@crc.skl.dnd.ca> <1991Apr16.032544.14016@leland.Stanford.EDU> Organization: DSG, Dept. of Comp. Sci., Trinity College, Dublin. Lines: 37 In <1991Apr16.032544.14016@leland.Stanford.EDU> goins@elaine30.Stanford.EDU (daryl goins) writes: >I am trying to write some graphics in a XwworkSpaceWidget but I am getting >a window error. Specifically, I have the following code >void main(argc, argv) >int argc; >char **argv; >{ > [...] > printf("main %d, toplevel, %d framework %d\n",XtWindow(mainWindow), > XtWindow(topLevel), XtWindow(framework)); > > XtRealizeWidget(topLevel); > XtAppMainLoop(app_con); >} > >when I print out the window values I get: >main 0 toplevel 0 framework 0 > >Obviously I'm doing something wrong, if anyone knows, I would >really really appreciate any advice. The windows of the widgets are not created until the call to XtRealizeWidget(); hence the value None (#defined to be 0) is returned. If you put the XtRealizeWidget() before the printf then you'll get non-zero values printed out. Ciaran. -- Ciaran McHale "I have some faults, but modesty isn't one of them." ---- Department of Computer Science, Trinity College, Dublin 2, Ireland. \ / Telephone: +353-1-772941 ext 1538 FAX: +353-1-772204 \/ Telex: 93782 TCD EI email: cjmchale@cs.tcd.ie