Properties, Variables, and PaintPot

An App Has Memory
  • Memory cells similar to those in a spreadsheet
  • RAM is random access memory (fast, short term memory, not database)
  • Memory consists of component properties and variables
    • e.g., Canvas.Width, Canvas.Height, Canvas.PaintColor
    • Variables -- "hidden" memory cells
  • set and get

Canvas has a number of properties, including Width, Height, PaintColor, LineWidth.

It does not have "dotSize", i.e., the size circles will be drawn. Thus we define a variable dotSize and when we call DrawCircle, the radius r is set to it.

User Interface components

is "read-only", in the sense that the end-user of the app can't change the text that appears. 

    But the app can change it with:     set Label.Text to 

  Textbox is for user input. Both the user and the app can change the text that appears.

    Typically, the user entering the text does not trigger an event. Usually we wait for a submit button to be clicked.

PaintPot Customization

    The PaintPot in the book lets you change the dotsize to Big or Small by clicking a button. The app arbitrarily 
        sets Big to 8 and Small to 2 (in pixels).

    You can give the end-user more flexibility by adding a TextBox to the UI and letting the user enter any number.

    DEMO: changing the LineWidth in PaintPot with a textbox