I'm working on a script that just does basic image editing. I have my image in one window, then clicking an "Image Options" window opens up a window with sliders for contrast and brightness. Whenever I close the image options window, it never actually closes, the window is just hidden. Hitting the "x" in the corner does nothing. I even added a "Close" button that just says << Close Window, but then it just hides it. In order to get it to close, I have to close JMP completely. Is there something I'm missing?
Names Default To Here( 1 );
img = Open( "$SAMPLE_IMAGES/windmap.png", "png" );
orig = New Image( img );
wind = New Image( orig );
slbval = 1;
slbval1 = 1;
w = New Window( "View Image",
vlb = V List Box(
Graph Box(
FrameSize( 500, 500 ),
X Scale( 0, 100 ),
Y Scale( 0, 100 ),
<<Add Image( image( wind ), bounds( top( 90 ), Left( 10 ), bottom( 10 ), Right( 90 ) ) )
),
Button Box( "Open options",
options;
optionswindowopen = 1;
)
)
);
refilter = Expr(
wind << Set Pixels( orig << Get Pixels );
wind << Filter( "Contrast", slbval );
wind << Filter( "Gamma", slbval1 );
);
refilter;
optionswindowopen = 0;
options = Expr(
imgop = New Window( "Image Options",
<<On Close(
optionswindowopen = 0;
),
V List Box(
tb = Text Box( "Contrast: " || Char( slbval ) ),
Slider Box(
0.01,
15,
slbval,
tb << Set Text( "Contrast: " || Char( slbval ) );
refilter;
vlb << reshow;
),
tb1 = Text Box( "Brightness: " || Char( slbval1 ) ),
Slider Box(
0.01,
5,
slbval1,
tb1 << Set Text( "Brightness: " || Char( slbval1 ) );
refilter;
vlb << reshow;
),
Button Box("Close",
imgop << Close Window;
)
)
)
);