I'm working on a project which will generate the area of a given geometric figure. There are a number of approaches I'm considering, however, I'm stuck when it comes to displaying a given calculation. For example, if I use variables for length and width, I want to be able to display the results of lengthXwidth. Thanks, Phil
Hi Phil,
The easiest way to do this is to make a ticking script which computes the computed value and then have a readout for this value. For example:
<ticking> foo's result <- foo's length * foo's width
and then the "result" readout will show the resulting value.
Cheers, - Andreas
----- Original Message ----- From: "Phil Firsenbaum" tacmanphil@mac.com To: squeakland@squeakland.org Sent: Wednesday, February 18, 2004 4:47 PM Subject: [Squeakland] Displaying a calculation in a text box
I'm working on a project which will generate the area of a given geometric
figure. There are a number of approaches I'm considering, however, I'm stuck when it comes to displaying a given calculation. For example, if I use variables for length and width, I want to be able to display the results of lengthXwidth.
Thanks, Phil _______________________________________________ Squeakland mailing list Squeakland@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Here's a simple approach in the picture below - many will work. I've taken a rectangle and a text morph out of the supplies flap. From the text morph's viewer drag out the 'numeric value' arrow from the basic category. Then you can drag your length X width calculation into the script as I've done using the length and width of the rectangle. Clicking the '!' in the script will calculate the area once; if you set the script to ticking it will update anytime the inputs vary, so you can change the size of the rectangle and watch the result as you do so. Hope that helps.
Tim Andrews
-----Original Message----- From: squeakland-bounces@squeakland.org [mailto:squeakland-bounces@squeakland.org] On Behalf Of Phil Firsenbaum Sent: Wednesday, February 18, 2004 10:48 AM To: squeakland@squeakland.org Subject: [Squeakland] Displaying a calculation in a text box
I'm working on a project which will generate the area of a given geometric figure. There are a number of approaches I'm considering, however, I'm stuck when it comes to displaying a given calculation. For example, if I use variables for length and width, I want to be able to display the results of lengthXwidth.
Thanks,
Phil
_______________________________________________
Squeakland mailing list
Squeakland@squeakland.org
squeakland@lists.squeakfoundation.org