Skip to main content
Engineering LibreTexts

2.05: Inspecting an Object

  • Page ID
    36406
  • \( \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}}\)

    You can test the effect of the code you have written by creating a new SBECell object and inspecting it.

    \(\bigstar\) Open a workspace. Type the expression SBECell new and inspect it.

    The left-hand pane of the inspector shows a list of instance variables; if you select one (try bounds), the value of the instance variable is shown in the right pane. You can also use the inspector to change the value of an instance variable.

    \(\bigstar\) Change the value of bounds to 0@0 corner: 50@50 and accept it.

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

    The bottom pane of the inspector is a mini-workspace. It’s useful because in this workspace the pseudo-variable self is bound to the object being inspected.

    \(\bigstar\) Type the text self openInWorld in the bottom pane and do it.

    The cell should appear at the top left-hand corner of the screen, indeed, exactly where its bounds say that it should appear. Blue-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.

    Resizing the cell.
    Figure \(\PageIndex{2}\): Resizing the cell.

    \(\bigstar\) Delete the cell by clicking on the x in the pink handle.


    This page titled 2.05: Inspecting an Object is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.