Subscribe Bookmark RSS Feed

Reset Button

rfeick

Community Trekker

Joined:

Sep 30, 2016

I have a script that creates a window to recieve user input via text edit boxes and checkboxes. I want there to be three buttons in the window, one of which is a reset button that clear all the checkboxes and reset the text edit boxe back to their defaults (either blank, "---", or "mm/dd/yyyy"). I've gotten the checkbox part to work, but can't figure out how to reset the text edit boxes. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is the example taken from the  Text Edit Box() area in the Scripting Index

     Help==>Scripting Index==>Text Edit Box==>Set Text

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Edit Box( "Example Text" )
);
text << Set Text( "New Text" );
Jim
5 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

The Scripting Index is the definative documentation on all of the elements that can be set, modified, etc. for any of the different functions/display objects.

Here is the JSL from the example for the setting of a check box.  The example is taken directlyu from:

      Help=>Scripting Index==>CheckBoxBox==>Set

Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box( {"One", "Two", "Three"} )
);
cb << Set( 3, 1 );
Jim
rfeick

Community Trekker

Joined:

Sep 30, 2016

You're right, the scripting index is quite helpful. I was able to use it and other resources to figure out how to reset the check boxes. However, even with the scripting index, I'm stumped as how to reset the text edit boxes. Right now I put in a work around to just close and then regenerate the whole window, but I'd like to find a better way if possible.

txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is the example taken from the  Text Edit Box() area in the Scripting Index

     Help==>Scripting Index==>Text Edit Box==>Set Text

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Edit Box( "Example Text" )
);
text << Set Text( "New Text" );
Jim
Craige_Hales

Staff

Joined:

Mar 21, 2013

If Jim's example isn't working for you, share an example of your JSL. There's probably something else going on that a second set of eyes will see.

Button script to set text edit boxButton script to set text edit box

Craige
rfeick

Community Trekker

Joined:

Sep 30, 2016

Thanks for the help! I think somehow I missed that example when using the scripting guide.