CHECKBOXCREATE

Synopsis
CHECKBOXCREATE parent group name label xpos ypos width height
Description

Creates a checkbox control. A checkbox control is used to give the user a selection between True and False. A checkbox must be associated with a groupbox control (see GROUPBOXCREATE).

The parent input is the name of the window that owns the new checkbox. If no window or dialog with that name exists, then the FMSLogo screen window is used as the parent.

The group input is the name of the group box control to associate with the new checkbox control.

The name input identifies the new checkbox and must be a unique word.

The label input is a word to write next to the checkbox.

The xpos input is the X coordinate where the upper-left corner of the new checkbox is placed.

The ypos input is the Y coordinate where the upper-left corner of the new checkbox is placed.

The width input is the width of the new checkbox.

The height input is the height of the new checkbox.

If the parent of the checkbox is the FMSLogo screen window, then the xpos, ypos, width, and height inputs are all given in turtle coordinates. Otherwise, they are given in "dialog units", the origin is the upper-left corner of the parent, and Y values increase as you move down the screen.

Example

Create a checkbox in a new window:

TO CHECKONTHINGS
  IFELSE CHECKBOXGET "myhideturtle [HIDETURTLE] [SHOWTURTLE]
END

WINDOWCREATE "main "mywindow "mytitle 0 0 100 100 []
GROUPBOXCREATE "mywindow "mygroupbox 10 10 80 40
CHECKBOXCREATE "mywindow "mygroupbox "myhideturtle [Hide Turtle] 20 20 60 20
BUTTONCREATE "mywindow "mybutton "Go 40 50 25 25 [CHECKONTHINGS]

Clicking on the Go button shows or hides the turtle,
depending on whether the checkbox is checked.

WINDOWDELETE "mywindow

Create a checkbox on the FMSLogo screen window:

TO CHECKONTHINGS
  IFELSE CHECKBOXGET "myhideturtle [HIDETURTLE] [SHOWTURTLE]
END

GROUPBOXCREATE "main "mygroupbox 110 90 140 60
CHECKBOXCREATE "main "mygroupbox "myhideturtle [Hide Turtle] 120 80 120 40
BUTTONCREATE "main "mybutton "Go 160 20 50 50 [CHECKONTHINGS]

Clicking on the Go button shows or hides the turtle, depending
on whether the checkbox is checked.

WINDOWDELETE "main


SourceForge.net Logo