Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!agate!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: vtn@cs.utexas.EDU (Vinod Thankappan Nair) Newsgroups: comp.windows.x Subject: (none) Message-ID: <9104090012.AA04743@nada.cs.utexas.edu> Date: 9 Apr 91 00:12:26 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 73 Hello, I have an application that needs to use a Motif DrawingArea Widget. This runs on a Stardent Titan, and the window is being used by a 3D package (Dore) for drawing images. The problem is, I need to create the actual window for the Widget using a special Stardent-specific call (XBCreateWindow) that permits Dore to directly call dedicated graphics hardware. Therefore, at Widget creation time, I set the widget's instance realize method to be a pointer to my realize function, that creates an Xwindow of the kind I need. So far so good, Dore is able to draw, events being handled correctly (I think), BUT ... If I try to fit a Frame widget, or a Form widget around this DrawingArea widget, it doesn't seem to understand the drawing window's geometry ( and God knows what else !) and draws the window as a tiny little square in a corner. Note that the window does show up normally with only ONLY a toplevel form above it, but add anything else like a frame to it, and it doesn't work. Here's the stuff that I do in the realize : ..... create_window(); the DrawingArea widget is Canvas. gatt is an XWindowAttributes structure. This sets up displayPtr and window. To get this to work as much as it does, I also needed to ensure that the parent of the newly created window was the (window of the parent_widget) of canvas. Either that or an explicit XReparent call. ..... XGetWindowAttributes(displayPtr, window, &gatt); canvas->core.window = window; canvas->core.x = (Position) 0; canvas->core.y = (Position) 0; canvas->core.width = (Dimension) gatt.width; canvas->core.height = (Dimension) gatt.height; canvas->core.depth = gatt.depth; canvas->core.border_width = (Dimension) 0; canvas->core.screen = gatt.screen; canvas->core.colormap = gatt.colormap; /* I don't think the stuff below this is needed, it would be done by procedures other than realize() at widget creation time */ canvas->core.self = canvas; canvas->core.widget_class = XtClass(canvas); canvas->core.name = XtNewString("canvas"); canvas->core.parent = parent_widget; canvas->core.sensitive = True; canvas->core.managed = True; canvas->core.mapped_when_managed = True; I think I have missed out something in the instance initialization procedure. Would somebody please help ? Thanx, Vinod. (vtn@cs.utexas.edu)