Author Topic: Checking when a button on a GUI is pressed?  (Read 1438 times)

I'm creating a GUI, however, I cannot settle with the simple command a button would do, I need to check when its pressed elsewere

Err.. I don't really understand what you want.

You could make it call a function that sets a global variable like $MyGUI::ButtonPressed to 1.

Code: [Select]
function MyGUI_ButtonPressed()
{
$MyGUI::ButtonPressed = 1;
//Do other stuff
}

function MyGUI_CheckButtonPressed()
{
if($MyGUI::ButtonPressed == 1)
{
//Do stuff
}
else
{
//Do other stuff
}
}

Just make the command the button does to MyGUI_ButtonPressed().


Perhaps about after pressing a button in the GUI a function is actually triggered.

Guys, the topic died and I alraedy figured it out lol