UIPushButton? with Jiggy???

Discussion in 'Jiggy Runtime Development' started by Commander147, Feb 3, 2008.

  1. Commander147

    Commander147 Member

    Oct 10, 2007
    Likes Received:
    iPhone 4 (Black)
    Hi I have Jiggy running and I am slowly starting to get used to the code. I get functions and creating labels and such but for some reason I can't make a regular button with UIPushButton. Can anyone post an example using it so far this is what I have

    var save = new UIPushButton( [ 20 , 351 , window.bounds[2]-40 ,40 ] );
    save.setEnabled = true;
    save.title = ("Save");
    mainView.addSubview( save );

    Nothing displays where the button is supposed to display and nothing is blocking it
    the label I have displays just fine Please someone help!!!
  2. curthard89

    curthard89 New Member

    Sep 15, 2007
    Likes Received:
    iPhone 3GS (Black)
    few things to note:

    in javascript or any language, its wise to add number together inside brackets

    var save = new UIPushButton( [ 20 , 351 , (window.bounds[2]-40) ,40 ] );

    2nd thing, why have u put save inside ()?

    title is not a function, its a variable

    so just use

    save.title = 'Save';

    lastly, you prob cant see it as you have no background

    so see if u can see it by changing the background color

    save.backgroundColor = [ 0 , 0 , 0 , 1 ];

    Please Register or Log in to view images

Share This Page