Skip to main content
Engineering LibreTexts

3.5: Inspecting an Object

  • Page ID
    39581
    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    You can immediately test the effect of the code you have written by creating a new LOCell object and inspecting it: Open a Playground, type the expression LOCell new, and Inspect it (using the menu item with the same name).

    The left-hand column of the inspector shows a list of instance variables and the value of the instance variable is shown in the right column (see Figure \(\PageIndex{1}\)).

    The inspector used to examine a LOCell object.
    Figure \(\PageIndex{1}\): The inspector used to examine a LOCell object.

    If you click on an instance variable the inspector will open a new pane with the detail of the instance variable (see Figure \(\PageIndex{2}\)).

    When we click on an instance variable, we inspect its value (another object).
    Figure \(\PageIndex{2}\): When we click on an instance variable, we inspect its value (another object).

    Executing expressions. The bottom pane of the inspector is a mini-playground. It’s useful because in this playground the pseudo-variable self is bound to the object selected.

    Go to that Playground at the bottom of the pane and type the text self bounds: (200@200 corner: 250@250) Do it. To refresh the values, click
    on the update button (the blue little circle) at the top right of the pane. The bounds variable should change in the inspector. Now type the text self openInWorld in the mini-playground and Do it.

    The cell should appear near the top left-hand corner of the screen (as shown in Figure \(\PageIndex{3}\)) and exactly where its bounds say that it should appear. Meta-click on the cell to bring up the Morphic halo. Move the cell with the brown (next to top-right) handle and resize it with the yellow (bottom-right) handle. Notice how the bounds reported by the inspector also change. (You may have to click refresh to see the new bounds value.) Delete the cell by clicking on the x in the pink handle.

    An LOCell open in world.
    Figure \(\PageIndex{3}\): An LOCell open in world.

    This page titled 3.5: Inspecting an Object is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.