Thread View: net.micro.mac
2 messages
2 total messages
Started by Kim Helliwell
Tue, 19 Mar 1985 20:39
GrafPort Scrolling Question
Author: Kim Helliwell
Date: Tue, 19 Mar 1985 20:39
Date: Tue, 19 Mar 1985 20:39
26 lines
2017 bytes
2017 bytes
I am working on a Mac application and have the following question for anyone who has gotten further than I have in understanding Mac arcana. Consider a window with a vertical scroll bar and some text in it. In order to scroll the text when the scroll bar is manipulated, you merely call TEScrollText (or something like that). Now, suppose what you have in the window is NOT merely the text of a single edit record, but several different entities (different TE records, for example). How does one scroll that stuff around? I have considered two approaches. The first is to do a SetOrigin to move the window's grafport where you want it and then repaint the window. The catch is that that moves the scroll bar out of the window, too! So what you have to do is SetOrigin, paint, SetOrigin back to normal, and call DrawControls. That quickly gets messy, esp if you want to use the mouse to point to and select object anywhere in the window. The second approach is to open an auxiliary GrafPort which you position over the actual display area of the window, and use that for displaying and manipulating the window contents and keep the window's GP intact for showing the scroll bar. Just describing this makes it sound like it's not going to work! Even if it did work, think about the mess you would have in moving the window around on the screen! Sooooo, how do you experts out there do this sort of thing? There must be a simpler way than I can see!
Re: GrafPort Scrolling Problems
Author: Brian Drummond
Date: Fri, 22 Mar 1985 20:31
Date: Fri, 22 Mar 1985 20:31
17 lines
1525 bytes
1525 bytes
As near as I understand it, your first proposed solution to the problem is the way to go about scrolling stuff around in a GrafPort. I'll admit it does get messy, but since you're only drawing the controls in a few places (in response to update events or mouse down events in the grow box, for example), I do't believe it's an unmanageable problem. The current software suppliment (2/85) contains a sample program called SCROLL which has the source (in what they call a 'vanilla version of C') demonstrating scrolling a TE field and some graphics. It shows how to scroll both/either in the horizontal/vertical directions, and as far as it goes, it's an educational experience... ...my first submission, please forgive any etiquette errors... Chuck McMath (using a friend's account) Department of EE & CS George Washington University Wash, D.C. 20052/ 202-676-5923
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads