I solved my own problem. I was just thinking to hard. All I had to do was use a global variable and check it Like this...


Code:

////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

////////////////////////////////////////////////////////////////////

BMAP* ingame_bmap1 = "panel_main.tga"; // my first bmap
BMAP* mouse_pcx = "mouse.pcx"; // bitmap used for the mouse pointer

/////////////////////////////////////////////////////////////////////



function brightness() //increase brightness
{
video_gamma = 150;
while (video_gamma > 50)
{
video_gamma -= 1;
wait(1);
}
}

function quit_program()//quit to desktop from main menu
{
while (key_any)
{
wait (1);
}
sys_exit(NULL);
}



void load_game()//load saved game from main menu
{
}

void options_main()//edit options from main menu
{
brightness();
}

var check_start = 0;//variable to check if start is pressed

function start_game()//start game from main menu
{
level_load("rpg.wmb");
wait(2);
check_start = 1;


}




PANEL* ingame_panel1 = // my first panel
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = ingame_bmap1;
flags = VISIBLE;
button (250, 335, "start_clicked.tga", "start_normal.tga", "start_over.tga", start_game, NULL, NULL);
button (250, 400, "load_clicked.tga", "load_normal.tga", "load_over.tga", load_game, NULL, NULL);
button (250, 465, "options_clicked.tga", "options_normal.tga", "options_over.tga", options_main, NULL, NULL);
button (250, 530, "quit_clicked.tga", "quit_normal.tga", "quit_over.tga", quit_program, NULL, NULL);
}

function main()
{
video_mode = 7; //set resolution
screen_color.blue = 150; //set screen background color
mouse_mode = 1; //set mouse mode



while (1) //cursor moves according how user positions mouse
{
if(check_start == 1)
{
ingame_panel1.flags &= ~VISIBLE;
}
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait(1);
}
}