int ButtonSetVisible(int bt, int flag);

 

Set a button visible or invisible, by default it is visible.

 

Return Value

 

Return value is not used.

 

Parameters

 

bt

Button handle returned from ButtonAdd().

 

flag

Visibility state of the button. 0 = invisible; 1 = visible.

 

Remarks

 

The ButtonSetVisible() function changes the visibility of a button.

 

Availability

 

Available in DragonFireSDK 1.1 and later.

 

Example

 

This sample puts two buttons on the screen and pressing one toggles the visibility of the other.

 

#include "DragonFireSDK.h"

 

int bt1;

int bt2;

int bt1v=1;

int bt2v=1;

 

int OnButton(int id)

{

  if (id==1)

   {

       bt2v=!bt2v; // Toggle bt2v flag

       ButtonSetVisible(bt2, bt2v);

   }

  else

  if (id==2)

   {

       bt1v=!bt1v; // Toggle bt1v flag

       ButtonSetVisible(bt1, bt1v);

   }

  return(id);

}

 

void AppMain()

{

   bt1=ButtonAdd("Images/Button",10,10,OnButton,1);

   bt2=ButtonAdd("Images/Button",100,10,OnButton,2);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}