Untested, but I'm positive it will work...
// Always define image filenames with the BMAP* pointer....
// Don't write the filename in the definition of buttons or panels!
// Do it like this:
BMAP* nxthhi = "nxt_hi.bmp";
BMAP* nxtorange = "nxtorange.bmp";
// Define a prototype of your function so it won't be an undeclared identifier:
function turn_on();
// Here, you DON'T set the SHOW flag. Also, VISIBLE is ONLY for old versions of A7,
// so don't use VISIBLE. Only use OVERLAY when you need black RGB(0,0,0) parts of
//a bmap to be invisible
PANEL* nxthi_panel =
{
bmap = nxthhi;
pos_x = 275;
pos_y = 170;
layer = 3;
flags = OVERLAY; // DONT PUT SHOW OR VISIBLE! The function will do that when you click button!
}
PANEL* button_panel =
{
pos_x = 340;
pos_y = 165;
layer = 3;
button(0, 0, nxtorange, nxtorange, nxtorange, turn_on, NULL, NULL);
flags = OVERLAY | SHOW;
}
// Now turn it on when you click....
function turn_on()
{
set(nxthi_panel, SHOW);
}
YOU were setting the flags of the nxthi_panel to SHOW when the program began. It's only supposed to show up when you click the button. So you DON'T put SHOW (NOR VISIBLE) in the panel's definition. That makes it visible on start up. Also, VISIBLE is no longer used for panels/bmaps. SHOW is the new keyword. I don't have any idea why you used it, unless you've got an old A7.
You could also *totally* omit the "flags = whatever " part from the definition of the panel, and just use:
set(nxthi_panel,SHOW | OVERLAY);
This is all really basic stuff. Be sure to use the manual and run through the workshops if you haven't yet...