PDA

View Full Version : moving a NSbutton




robijnix
Nov 6, 2010, 10:55 AM
Hello,

I just started programming in cocoa and I'm trying to make a very simple game in which the user has to press a moving button
but I can't find anyway to change the position of a button.
So i wonder, is there a way? and if there is, what it is?



robbieduncan
Nov 6, 2010, 11:35 AM
Look at the documentation for the superclasses, particularly the frame of NSView.

robijnix
Nov 6, 2010, 12:00 PM
thanks man:D
that solved it.

now i just have one more question:
i notice that this cocoa thing is really event driven. how can i do something continously.
in my case: how can i make the origin.x and origin.y change automaticly all the time, whitout something like a button press? i already tried to look for a timers object or something but could find one.

robbieduncan
Nov 6, 2010, 12:36 PM
Look at the NSTimer documentation