BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
Jaz
Jaz
Frequent Contributor

Adding a Check Box to a Previously Created Window

Hi,

 

I was attemtping to add a check box to my previously created window like so:

 

singleFileButton1 = Function( {x},
	mainWindow << Close Window;
	choosingFilesWindow = New Window( x,
		ob = Outline Box( "Select Your Files: ",
			Text Box( "<b>Please select one of the options below to choose your files: </b>", <<Markup( 1 ) ),
			Button Box( "Select File 1", selectFile1Button( "Select File 1" ) ),
			Button Box( "Select File 2", selectFile2Button( "Select File 2" ) )
		);
		FileCB = Check Box( {""}, <<Set( 1 ), <<Enable Item( 1, 0 ), Show( FileCB << Get() ) );
	)
)

It creates the checkbox but in a new window, not the choosingFilesWindow.

Any help would be appreciated.

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Adding a Check Box to a Previously Created Window

Your are ending the window definition when you specify the ";" at the end of the definition of the Outline Box().  Change it to a "," and it will work as you want

singleFileButton1 = Function( {x},
	mainWindow << Close Window;
	choosingFilesWindow = New Window( x,
		ob = Outline Box( "Select Your Files: ",
			Text Box(
				"<b>Please select one of the options below to choose your files: </b>",
				<<Markup( 1 )
			),
			Button Box( "Select File 1", selectFile1Button( "Select File 1" ) ),
			Button Box( "Select File 2", selectFile2Button( "Select File 2" ) )
		),
		FileCB = Check Box( {""}, <<Set( 1 ), <<Enable Item( 1, 0 ), Show( FileCB << Get() ) );
	);
)
Jim
5 REPLIES 5
txnelson
Super User

Re: Adding a Check Box to a Previously Created Window

Your are ending the window definition when you specify the ";" at the end of the definition of the Outline Box().  Change it to a "," and it will work as you want

singleFileButton1 = Function( {x},
	mainWindow << Close Window;
	choosingFilesWindow = New Window( x,
		ob = Outline Box( "Select Your Files: ",
			Text Box(
				"<b>Please select one of the options below to choose your files: </b>",
				<<Markup( 1 )
			),
			Button Box( "Select File 1", selectFile1Button( "Select File 1" ) ),
			Button Box( "Select File 2", selectFile2Button( "Select File 2" ) )
		),
		FileCB = Check Box( {""}, <<Set( 1 ), <<Enable Item( 1, 0 ), Show( FileCB << Get() ) );
	);
)
Jim
Jaz
Jaz
Frequent Contributor

Re: Adding a Check Box to a Previously Created Window

Thanks, that fixed it.

0 Kudos
Jaz
Jaz
Frequent Contributor

Re: Adding a Check Box to a Previously Created Window

Hi,

 

I've looked through the scripting index for CheckBoxBox for a way to set the position of the check box in the window but can't seem to find any such function. I want the check box to sit beside each of my buttons. Any suggestions?

0 Kudos
Jaz
Jaz
Frequent Contributor

Re: Adding a Check Box to a Previously Created Window

Hi, I've looked through the scripting index for CheckBoxBox for a way to set the position of the check box in the window but can't seem to find any such function. I want the check box to sit beside each of my buttons. Any suggestions?

0 Kudos

Re: Adding a Check Box to a Previously Created Window

Liine Up Box( N Col(2), check box, button, check box, button, ... )?

 

H List Box(

  V List Box( check box, check box, ... ),

  V List Box( button, button, ... )

)?

Learn it once, use it forever!