Objects¶
Objects are the building blocks of your GUI. Each object has a different set of uses, attributes, and functions.
Button¶
A button is a clickable object.
Example syntax:
make Button b.
make Button b with text "Hello".
make Button b with text "Hello", position 100 25.
set b action close.
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
text | Words on button |
|
“Untitled Button” |
position | location of button on window |
|
center |
size | size of button |
|
medium |
action | Effect when button clicked |
|
none |
hidden | Determines if button visible (false) or invisible (true) |
|
false |
Window¶
A window is the frame on which you create your GUI. The window is always the first object you make.
Example syntax:
make Window w with size 500 500, color green.
set w title "My favorite GUI".
Attributes:
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
title | The name as displayed in the top bar of the window. |
|
“Untitled Window” |
size | The width and height of the window |
|
medium |
color | The color of the window background |
|
white |
action | The effect from interacting with a window. |
|
none |
font | The font for all text used in the window |
|
Times New Roman |
fontSize | Size of text |
|
12 |
textColor | Color of text |
|
black |
Checkboxes¶
Checkboxes are square boxes the user can click on to select any number of options. If you create a Checkboxes object without the options attribute, it will have three default checkboxes labeled “Option 1”, “Option 2”, and “Option 3”. Placing an asterisk before any of the attributes will mark that option to be selected by default.
Example syntax:
make Checkboxes c with options "hello" "yellow" "fellow".
set c position 20 20.
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
title | text above checkbox set |
|
“Untitled Checkboxes” |
options | The Checkboxes labels. |
|
*”Option 1” “Option 2” “Option 3” |
position | location of checkbox set in window |
|
center |
RadioButtons¶
RadioButtons are circular buttons a user can click to select one option out of many. If you create a RadioButtons object without the options attribute, it will have three default buttons labeled “Option 1”, “Option 2”, and “Option 3”. Placing an asterisk before one of the attributes will make that option to be selected by default.
Example syntax:
make RadioButtons r with options "hello" "mello" "jello".
set r title "Choose one:".
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
title | text above RadioButtons set |
|
“Untitled RadioButtons” |
options | The RadioButtons labels. |
|
*”Option 1” “Option 2” “Option 3” |
position | location of RadioButtons set in window |
|
center |
Text¶
Text is a simple text region the user cannot interact with.
Example syntax:
make Text t with text "Welcome to Gooey! Please leave your shoes at the door."
set t color blue.
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
text | unmutable words in a window |
|
“Text” |
position | location of text in window |
|
center |
size | size of text |
|
medium |
color | color of text |
|
black |
hidden | Determines if text visible (false) or invisible (true) |
|
false |
TextBox¶
TextBox objects create a space where users can type. When you create a TextBox with a text attribute, the value entered will appear as default text within the text box.
When setting the size of the TextBox using integers for width and height, the integers will set the width and height by character count. For example, size 15 10 will create a TextBox 15 characters across, with ten lines of height.
Example syntax:
make TextBox tb with text "Write your answer here".
set tb size large.
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
text | mutable words within the TextBox |
|
“Type Here” |
position | location of TextBox in window |
|
center |
size | size of TextBox |
|
medium |
hidden | Determines if TextBox visible (false) or invisible (true) |
|
false |
Image¶
Images are pictures you can add your your Gooey. The image must be in .gif format although the movement will not be maintained.
Example syntax:
make Image i with title "Apple", text "This is my most favorite apple", source "images/apple.gif".
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
hidden | Determines if Image visible (false) or invisible (true) |
|
false |
source | path or filename of Image |
|
defaultIcon |
FormattedText¶
FormattedText is an object that stores values for a text with different formatting options. It is first created by the user with attributes of their choice and then can be used in button text, checkboxes/radiobutton titles, and text objects.
Example syntax:
make FormattedText t with text "Hello World!", font "Arial", size 15, color blue, bold true, italic true, underline true.
make Button b with text t.
make Checkboxes c with title t, options "Yay" "Nay", position 50 50, size medium.
Attribute | Description | Possible Values | Default Value |
---|---|---|---|
text | text to be stored in object |
|
“Untitled Text” |
font | font of text |
|
“Times” |
color | color of text |
|
black |
size | size of text |
|
12 |
bold | Determines if the text is bold (true) or not (false) |
|
false |
italic | Determines if the text is italicized (true) or not (false) |
|
false |
underline | Determines if the text is underlined (true) or not (false) |
|
false |