if texture used from class it does not show in game, advice needed?

here is the test class i made:

class Button extends Object{

    //VARIABLES
    var x:int;
    var y:int;
    var w:int;
    var h:int;

    var texture:Texture2D;

    //CONSTRUCTOR
    function Button(){

        x=10;
        y=10;
        w=30;
        h=30;

    }

    function Show(){

        if(GUI.Button(Rect(x,y,w,h),texture)){

            Debug.Log("Button Pressed!");

        }   
    }
}

slot for texture appears when i create the object in other script. here is how i did it:

var TestButton : Button;

then in the OnGUI function i just type this:

TestButton.Show();

the button shows and it works but texture is not there but i put it in the slot from the inspector, what i am doing wrong?

here is the screenshot:

alt text

The default references doesn't work like that - it lets you set what the variables will be set to when you drag that script onto a gameobject

Since your class isn't a monobehaviour, the default references is completely useless to you for it

Try looking into Resources.Load instead, it'll load from the /Assets/Resources folder at runtime