Example: If you want it to open/close a window:

Define a panel that contains the first window's data.

Code:

bmap window1_bmp= "window1.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}



Then, define a second panel that contains the second window's data (be sure to add another bmap definition, though, ).

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}



Now you need to make a function that will toggle the visibility of the second window.

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}

function toggle_windows()
{
window2_pan.visible= (window2_pan.visible== off);
}



Next, define a button in the window1_pan definition that will execute the function.

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
button(x,y,"button_clicked.bmp","button_inactive.bmp","button_mouse_hover.bmp",toggle_windows,null,null);
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}

function toggle_windows()
{
window2_pan.visible= (window2_pan.visible== off);
}



And there you have it! A button in a window that toggles another window.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}