finus@phcisa.UUCP (Finus van Cadsand) (07/20/90)
Using the bulletin board widget of Open Look I represent some widgets at particular coordinates. I want to draw lines or arrows between some of these widgets. But somehow what is drawn to the bulletin board never appears at the screen, not even after the bulletin board has been realised. Investigation shows that for the bulletin board widget no expose procedure is defined, which gives an indication why nothing appears. Now I have two questions: 1. is my line of reasoning okay ? 2. maybe somebody knows a workaround ? like a specialization of the bulletin board that handles expose events ? please comment. --------------------------------------------------------------------------------Finus van Cadsand, ORIGIN-MW, Eindhoven, the Netherlands email: finus@ait.philips.nl (will be changed to: finus@ait.origin.nl)
grp@unify.uucp (Greg Pasquariello) (07/23/90)
In article <836@phcisa.UUCP> finus@phcisa.UUCP (Finus van Cadsand) writes: > > Path: unify!csusac!csuchico.edu!petunia!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!phcisa!finus > From: finus@phcisa.UUCP (Finus van Cadsand) > Newsgroups: comp.windows.x > Keywords: bulletin board,drawing > Date: 20 Jul 90 09:33:58 GMT > Lines: 17 > > Using the bulletin board widget of Open Look I represent some widgets at > particular coordinates. I want to draw lines or arrows between some of > these widgets. But somehow what is drawn to the bulletin board never > appears at the screen, not even after the bulletin board has been realised. > > Investigation shows that for the bulletin board widget no expose procedure > is defined, which gives an indication why nothing appears. > > Now I have two questions: > > 1. is my line of reasoning okay ? Yes, without the expose procdure, no redrawing will occur. > > 2. maybe somebody knows a workaround ? like a specialization of the > bulletin board that handles expose events ? please comment. This is one way to go about it, and IMO probably the best way. Simply sublcass the widget and provide an expose procedure. Note that you will also have to provide a foreground resource (and a GC) because the bulletin board does not provide one for you. Another way to go about this, would be to use the stub widget to provide the drawing capabilities. Basically you can hook your own routines into the stub's methods. Then, create a hierarchy where the bulletin board is the base, and the stub and all your other widgets are siblings. If you map your widgets on top of the stub, you will get the desired effect. > > --------------------------------------------------------------------------------Finus van Cadsand, ORIGIN-MW, Eindhoven, the Netherlands > email: finus@ait.philips.nl (will be changed to: finus@ait.origin.nl) -- -Greg Pasquariello grp@unify.com
alecci@attunix.att.COM (07/24/90)
> Using the bulletin board widget of Open Look I represent some widgets at > particular coordinates. I want to draw lines or arrows between some of > these widgets. But somehow what is drawn to the bulletin board never > appears at the screen, not even after the bulletin board has been realised. > > Investigation shows that for the bulletin board widget no expose procedure > is defined, which gives an indication why nothing appears. > > Now I have two questions: > > 1. is my line of reasoning okay ? > > 2. maybe somebody knows a workaround ? like a specialization of the > bulletin board that handles expose events ? please comment. > > -------------------------------------------------------------------------------- > Finus van Cadsand, ORIGIN-MW, Eindhoven, the Netherlands > email: finus@ait.philips.nl (will be changed to: finus@ait.origin.nl) right, the bulletin board does not express interest in expose events. The easiest and most straight-forward solution to your problem is to add an event handler (using XtAddEventHandler) to the bulletin board widget that expresses interest in exposures (event_mask set to ExposureMask). Once this is done, your registered routine is called whenever the graphics in the bulletin board needs refreshing. For example: /* ARGSUSED */ static void DrawLines(w, client_data, xevent, continue_to_dispatch) Widget w; /* the bulletin Board's id */ XtPointer client_data; /* your data */ XEvent * xevent; /* real XEvent */ Boolean * continue_to_dispatch; /* ignored */ { .... /* your interesting code */ } /* end of DrawLines() */ .... somewhere in your creation code .... bbw = XtCreateManagedWidget(name, bulletinBoardWidgetClass, parent, args, num_args); XtAddEventHandler(bbw, ExposureMask, False, DrawLines, NULL); Note: If you create and destroy the bulletin board widget often, you may want to remove your added event handler to free any associated memory. For Example: XtRemoveEventHandler(bbw, ExposureMask, False, DrawLines, NULL); XtDestroyWidget(bbw); -o Don P.S. If you were simply doing graphics without adding children to the bulletin board widget, I would have suggested using the Stub Widget instead since it allows a programmer to specify (via a resource) a drawing routine as well as provide exposure compression.