Path: utzoo!attcan!uunet!ginosko!usc!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Viewport Widget. (Athena tools) Message-ID: <8908181541.AA07405@expo.lcs.mit.edu> Date: 18 Aug 89 15:41:43 GMT References: <3692@ncsuvx.ncsu.edu> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 42 > I am trying to use a viewport widget to display images. This widget has one > child - a box widget to which I spit the image data. While writing a call > back proc for the viewport widget, I need to access the child. I tried the > naive > Childwidget = vpwidget->viewport.child; > It bombed of course. Am I missing something here ? The ONLY accepted method of accessing widget data is through the resource list. Going directly into the widget structure is ugly, and you get what you deserve when the next release comes out and things have been restructured internally. > Also, I am confused about the *.h and the *P.h header files. How does the > compiler figure out all the declarations and #defines in the *P.h files without > #includes ? Am I missing something obvious here ? the *P.h are private header files and should only be used by the widget itself and its subclasses. If you as an application writer have to include it the you are doing something wrong. Now to solve your problem... I am a bit confused as to what you are trying to do, if you want to draw into a widget why use a Box widget? You would be better served by just using a core widget (class widgetClass). The Box has a bunch of geometry manager stuff that you don't need. I assume that the only reason to use a viewport is to scroll your image? If so then why do you need access to the child? And since you created the child why can't you just use the widget id of your Box (or Core) widget. As you can see I am not really sure enough of what you are doing to be of much help, but I hope that there is something in here that you can use. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213