Help Contents / GUI programming / CheckBoxes / CheckBox

CheckBox parent alabel onclick
(CheckBox parent alabel onclick style apos size)

outputs a new CheckBox on the parent (a Frame or a Graph), 

having the text alabel on it, 

and running the onclick instructionlist when the user clicks with the mouse on it. 



style can be a combination (use +) of the following constants: 

wxCHK_2STATE  Create a 2-state checkbox. This is the default. 

wxCHK_3STATE  Create a 3-state checkbox. Not implemented in wxMGL, wxOS2 and wxGTK built against GTK+ 1.2. 

wxCHK_ALLOW_3RD_STATE_FOR_USER By default a user can't set a 3-state checkbox to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking. 

wxALIGN_RIGHT  Makes the text appear on the left of the checkbox. 



apos is the position of the Button (a list of two integer numbers, x and y), 

size is the size of the Button (again a list of two integer numbers, width and height). 

Examples: 

	cbpd=CheckBox [][Pen Down][ 
		ifelse CheckBoxValue cbpd [PenDown][PenUp] 
		updateGraph] 
	cbht=(CheckBox [][Hide Turtle][ 
		ifelse CheckBoxValue cbht [hideTurtle][showTurtle] 
		updateGraph] 
		wxBU_LEFT+wxBU_TOP [0 100][200 100]) 


next: CheckBoxDestroy
