El 10/18/08 8:02 AM, "Vijay Mathew" <[EMAIL PROTECTED]> escribió:

> Hi,
> 
> I would like to know how I can design this simple credentials form in Squeak.
> There will be a text field, one password field and two buttons. Is there a
> Morphic widgets library? Do I have to implement my own widgets?
> 
> Thanks,
> 
> -- Vijay


Short answer is no.
Look in World menu for item new morph...
>From alphabetical list select BorderedMorph.
Via halo , select it and bring debug menu.
In debug menu select inspect.
In lower panel (code panel) type self extent and then print it.
Should answer [EMAIL PROTECTED], meaning your morph have 50 pixels width and 40 
pixels
height.
For change this, do self width: 480;height: 320;color: color: Color
paleYellow.

Now go again to World menu for item new morph..

Repeat again debug menu select inspect.
In lower panel (code panel) type self contents: 'My Widget'.
Via Halo select the StringMorph , via red menu icon select "embed into
BorderedMorph"

You wish know the code version of this ?
Select your widget and via halo, debug, inspector evaluate self
constructorString

In my case I have

'(((BorderedMorph newBounds: ([EMAIL PROTECTED] corner: [EMAIL PROTECTED]) 
color: Color
paleYellow) setBorderWidth: 2 borderColor: Color black)
    addAllMorphs: (Array
    with: ((StringMorph newBounds: ([EMAIL PROTECTED] corner: [EMAIL 
PROTECTED]) color: Color
black) contents: ''My Widget'')))'

Same procedure could be applied for buttons, etc.

Once you build the widget, could made your own class from it.
Or when you learn which messages the widget could understand via morph
protocol item, you start to made more efficient code

| myWidget|
myWidget := BorderedMorph  new.
myWidget extent: [EMAIL PROTECTED];color: Color paleYellow.
myWidget addMorph: ( StringMorph new; contents:'My widget').
(myWidget submorphs at:1) position: myWidget topLeft + ([EMAIL PROTECTED]).
myWidget openInWorld "here is at [EMAIL PROTECTED])

myWidget openInHand "here you put in any place"

Enjoy and I could be reached in Skype as edgardec from 18 to 21 GMT for all
here

Edgar



 




_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to