jgraham@crc.skl.dnd.ca (Jay Graham) (03/25/91)
I need to implement pixmaps in my application the same way (I think) that the cursor is implemented. Does anyone know who I can talk to to find out how the cursor is implemented? I am using X11R3. Thanks in advance. Jay Graham Software Kinetics Ltd., Ottawa, Ontario, Canada, jgraham@crc.skl.dnd.ca
goins@elaine30.Stanford.EDU (daryl goins) (04/16/91)
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;
{
Widget topLevel, framework, mainWindow;
XtAppContext app_con;
topLevel = XtAppInitialize(&app_con, "Xlist", NULL, ZERO,(Cardinal *)
&argc, argv, resources, NULL, ZERO);
framework = XtCreateManagedWidget("framework", XwformWidgetClass, topLevel,
NULL, ZERO);
mainWindow = XtCreateManagedWidget("mainWindow",XwworkSpaceWidgetClass,
framework, NULL, ZERO);
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. If you have a piece of code
I would be even more thankful.
Daryl M. Goins
--
Daryl M. Goins
goins@cs.stanford.edu
"I said that but
I didn't know what I was talking about??" - Money Jones
aw@jello.bae.bellcore.com (Andrew Wason) (04/18/91)
In article <1991Apr16.032544.14016@leland.Stanford.EDU>, goins@elaine30.Stanford.EDU (daryl goins) writes: > 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 A widgets windows are not created until the widget is realized. Move your printf statament to after the XtRealizeWidget call. Andrew _______________________________________________________________________________ Andrew Wason Bell Communications Research aw@bae.bellcore.com Piscataway, NJ bellcore!bae!aw
cjmchale@cs.tcd.ie (Ciaran McHale) (04/18/91)
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