Shoutbox

[help] function OnEvent_MenuClicked with window already open - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [help] function OnEvent_MenuClicked with window already open (/showthread.php?tid=71123)

[help] function OnEvent_MenuClicked with window already open by LifelesS on 01-28-2007 at 01:44 PM

Does anyone knows a function that if a Interface Windows is already open, don't open it again?

I'll explain. If you open a Interface Windows, go back to the menu and open it again, it will open 2 windows.


RE: [help] function OnEvent_MenuClicked with window already open by NanaFreak on 01-28-2007 at 01:49 PM

function OnEvent_MenuClicked(MenuId){
if(MenuId=="123" && blah != true){
//open window
blah = true
}
}

i think that shoutd do it for you ;)


RE: [help] function OnEvent_MenuClicked with window already open by Felu on 01-28-2007 at 01:50 PM

Declare the Window as a global variable and then if the window is open the variable shall return true else false. So

code:
var Wnd;//Declaring as global variable
/* Event */
if(!Wnd){
/* Open Window/*
}


RE: [help] function OnEvent_MenuClicked with window already open by LifelesS on 01-28-2007 at 01:57 PM

Thanks NanaFreak and Felu, I got it working with Felu method.

I also added an OnWindowIDEvent_Destroyed() { Wnd = null; }

or it doesn't work when you actually close the window lol