QUICK REFERENCE: BUTTON

I believe that you is not satisfied with the size of the title in the Button of the previous lesson. How to change it?

It's time to present the properties and methods of the main graphic 2D objects of the Squeak-Croquet API.

Like we said, you will use ever, if possible, the graphic environment of Squeak-Croquet for the creation of your application. So, our "reference" will present some graphic solutions also.

Our first object will be the Button

The object Button has another object inside it: String - the label of the button.

The "normal" instantialization of the Button is graphic, dragging it from the "Green window":

Some properties to be used in code (some are graphic solutions):


position

Drag the Move button of the Halo.


size

Drag the Size button of the Halo.


mouseDown, mouseStillDown, mouseUp, mouseEnter, mouseLeave, mouseEnterDragging, mouseLeaveDragging

NOTE OF THE BETA VERSION: The "mouseDown" is not working. Use "mouseUp" for a click and "mouseStillDown" if the user needs to press the button.

We usually glue an script to a button. To define the event that will start the script, click the button "normal" in the Script Editor (that window where we do code) and select an option.


setLabel:'abcdef'.

The command can be used inside an script or you can select this action in the Menu (of the Halo) or Viewer. There are many ways to do the same thing in Squeak-Croquet.


sendToBack, bringToFront, embedInto

This is relative to another object.


changeColor

Changes the background color


changeColorOfString

You need to open the Menu of the object String that is inside the object Button.


changeFontOfString

You need to open the Menu of the object String.


borderColor, borderWidth, borderStyle


shadowColor, shadowOffset


gradientFill, secondColor, radialFill


show


hide


PREVIOUS LESSON NEXT LESSON
T. CONTENTS HOMEPAGE

DISCLAIMER: This material can be translated for any language, and reproduced total or partially by anybody using any type of media. But, please, don't put your name like author. And let me know if it was useful (americo@dmu.com).The use of any code, 3D model or technique published is free and doesn't need to have any reference about this source. The author is not responsible for any damage that the material can cause.