Cocoa/Objective-C Question
Hi everyone,
Firstly I wanted to say thank you to all the contributors who have provided good advice for myself and others to use, while some people might not be thankful, I assure you that there are many of us out there who really do appreciate the help given.
I have written a small cocoa app which is basically just a simple user interface. It consists of a window with shapes that you can draw inside it. It also has scrollbars for when the background (or image) is smaller than the window itself. The problem I am having is that when I click and drag a shape (to move it), it does not automatically scroll (for example, if I click inside the shape and drag the mouse down below the bottom of the window, it will not scroll down as I would like it to).
Any help would be greatly appreciated.
p.s. I have googled all over the place for this but the closest thing I have found is grab-scrolling code on this page: http://iratescotsman.com/products/source/)
Thanks!
Firstly I wanted to say thank you to all the contributors who have provided good advice for myself and others to use, while some people might not be thankful, I assure you that there are many of us out there who really do appreciate the help given.
I have written a small cocoa app which is basically just a simple user interface. It consists of a window with shapes that you can draw inside it. It also has scrollbars for when the background (or image) is smaller than the window itself. The problem I am having is that when I click and drag a shape (to move it), it does not automatically scroll (for example, if I click inside the shape and drag the mouse down below the bottom of the window, it will not scroll down as I would like it to).
Any help would be greatly appreciated.
p.s. I have googled all over the place for this but the closest thing I have found is grab-scrolling code on this page: http://iratescotsman.com/products/source/)
Thanks!
NSView:
- (BOOL)scrollRectToVisible:(NSRect)aRect
Should do what you want, if you call this periodically with the rect of the image you are dragging...
- (BOOL)scrollRectToVisible:(NSRect)aRect
Should do what you want, if you call this periodically with the rect of the image you are dragging...
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Please help me with problem (OpenGl\Cocoa\Objective-C) | wyrmmage | 4 | 3,112 |
Aug 20, 2006 05:48 PM Last Post: wyrmmage |
|
| Newbie question: Cocoa and Carbon - which for what and how to get started? | BliTz | 3 | 2,851 |
Jul 27, 2006 10:07 PM Last Post: OneSadCookie |
|
| Quick threaded OpenGL drawing question in Cocoa | TomorrowPlusX | 2 | 3,558 |
Nov 11, 2004 05:23 AM Last Post: TomorrowPlusX |
|
| Cocoa Filename Question | Joseph Duchesne | 3 | 3,045 |
Oct 26, 2003 03:55 PM Last Post: Joseph Duchesne |
|
| Cocoa: Tile Question | Criollo | 15 | 5,229 |
Oct 3, 2003 02:02 AM Last Post: Criollo |
|

