[self convertPoint:eventLocation fromView:nil];
m_controller->left_mouse_dragged(center.x, center.y);
}
-graham
On May 27, 2008, at 10:48 PM, Jens Alfke wrote:
On 27 May '08, at 8:38 PM, Graham Reitz wrote:
Do folks somehow get the direction of the drag, size of the
rectangle,
What is the typical information that people get from a mouse dragged
event?
I have the following:
- (void) mouseDragged:(NSEvent*)event
{
NSPoint eventLocation = [event locationInWindow];
NSPoint center = [self convertPoint:eventLocation fromView:nil];
m_controller->lef
Thanks Eric. I have a CustomOpenGLView example that I downloaded from
the apple development site (http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/listing5.html
).
Hopefully that has what I am looking for.
Use NSOpenGLView. It's whole reason to exist is to simplify setup
and use
I think I am close but don't understand how the coordinate system of
an NSView relates to the NSWindow it resides in.
It looks like the NSView setFrame method will help but I am getting
weird results. Am I on the right track?
thanks,
graham
___
Thanks Greg! Works great.
About the time I noticed your post I had ended up with this: (seems
to work)
- (void) drawRect: (NSRect) rect
{
NSWindow* main_window = [self window];
NSRect window_rect = [main_window frame];
NSLog(@"my_window_width=%f, my_window_height=%f",
window_r
he frame of the view has been
changed. I don't know of a message to track it real time.
Scott
On May 25, 2008, at 4:00 PM, Graham Reitz wrote:
How do you detect a resize event?
I can see that lockFocus and drawRect are getting called.
Is there a method to help determine if the user is r
taking place, see here:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/CocoaLiveResize.html
You'll want to override the -viewWillStartLiveResize and -
viewDidEndLiveResize methods.
Hope this helps,
- Greg
On May 25, 2008, at 4:00 PM, Graham
How do you detect a resize event?
I can see that lockFocus and drawRect are getting called.
Is there a method to help determine if the user is resizing the window?
thanks,
graham
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not p
Outstanding! Thanks Jens!
Did you just type that up now? That seems like a lot of effort.
Much appreciated,
-graham
On May 25, 2008, at 2:41 AM, Jens Alfke wrote:
On 24 May '08, at 10:29 PM, Graham Reitz wrote:
Can I think of an @interface as something similar to a c++ class?
Sorry, assume the @implementation/@end are there. It's not an example
meant to compile.
It sounds like what I listed can be considered synonymous with a c++
class?
thanks,
-graham
On May 25, 2008, at 12:36 AM, stephen joseph butler wrote:
On Sun, May 25, 2008 at 12:29 AM, Graham
I am coming from the c++ world and I feel I don't understand how
objects are scoped in obj-c.
What is the scope of m_controller (a c++ class) below? The debugger
shows m_controller as {...} with no other information. Other than that
it seems to run fine.
Can I think of an @interface a
board
events are sent to the first responder and then up the responder
chain, unlike mouse events which are sent to the actual object
clicked.
-Pete
On May 24, 2008, at 10:37 PM, Graham Reitz wrote:
1) Create a simple Cocoa application
2) Open IB and drag a Custom View over to the Window
3)
1) Create a simple Cocoa application
2) Open IB and drag a Custom View over to the Window
3) Name the Custom View class
4) Write the class files and add them to the project
5) Derive a class from NSView and implement the keyDown method.
- (void)keyDown:(NSEvent *)theEvent;
6) Run the prog
I am endeavoring to learn openGL gui development on the Mac.
Any comments on the follow code would be greatly appreciated, i.e.
what's wrong, pathological and etc...
thanks,
graham
Code---
// simple.h
#import
@interface simple : NSView
{
@private
NSOpenGLContext *m_con
What is the preferred method to halt a cocoa application on a runtime
error occurring in the initWithFrame method?
thanks,
graham
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the l
Awesome! Thanks Nathan. That makes a lot more sense to me.
Just set the class of the Custom View.
What do you specifically mean by 'set the class'?
graham
On May 24, 2008, at 7:01 PM, Nathan Kinsinger wrote:
On May 24, 2008, at 5:43 PM, Graham Reitz wrote:
(fyi) I am comin
(fyi) I am coming from the non Mac C++ land and I am trying to grok
Obj-C and the Cocoa framework.
1) Create a simple Cocoa application
2) Open IB and drag a Custom View over to the Window
3) Drag an Object to MainMenu.nib
4) Name the Custom View and Object to the same class name
5) Write the c
17 matches
Mail list logo