moving a NSbutton

Discussion in 'Mac Programming' started by robijnix, Nov 6, 2010.

  1. macrumors newbie

    Joined:
    Nov 6, 2010
    #1
    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?
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Look at the documentation for the superclasses, particularly the frame of NSView.
     
  3. thread starter macrumors newbie

    Joined:
    Nov 6, 2010
    #3
    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.
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Look at the NSTimer documentation
     

Share This Page