View Single Post
Old 03-12-10, 03:18 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by AOTD_Rhonen View Post
Hi guys,

anyone can help me by adding an Event on a Button?
Code:
def InitializeScript():
 
    Show = False
    Pagerecognitionmanual_Recmanual_Unit.Visible=False
    Pagerecognitionmanual_Recmanual_Criticalzones.Visible=False
    Pagerecognitionmanual_Recmanual_Cover.Visible=False
    Pagerecognitionmanual_Recmanual_Openbook.Visible= True
    SetReconEvents()
 
    #pass
 
def SetReconEvents():
    ScriptManagerManaged.ShowPythonError("SETEVENTs")
    Pagerecognitionmanual_Recmanual_Cover_Close.MouseLeftButtonClicked += OpenCloseManual
    Pagerecognitionmanual_Recmanual_Openbook_BtnOpen.MouseLeftButtonClicked += OpenCloseManual
    #pass
 
def OpenCloseManual():
    ScriptManagerManaged.ShowPythonError("EVENT")
So i get my Initialize and i get my Message on SetReconEvents()

But if i click on the BtnOpen ingame, nothing happens... so OpenCloseManual() is not handled ... Any Ideas?

And yes, i am working on the Reconitionmanual.
Both, Pagerecognitionmanual_Recmanual_Cover_Close.MouseL eftButtonClicked and Pagerecognitionmanual_Recmanual_Openbook_BtnOpen are Buttons
for the control you want to add an event to use this syntax:

control.action += name of function to call

where control = the name of the control (i.e. Pagelayout_Groupfeedback)
action = the action the user did (i.e. MouseIn, MouseOut, MouseLeftButtonClicked, etc.)
TheDarkWraith is offline   Reply With Quote