|
tehpopa Newbie
Joined: 01 Jun 2011 Posts: 4
|
Posted: Mon Apr 09, 2012 10:53 pm
Send commands to main window? |
I've got a secondary window that I use to monitor my stats. Now I'm looking to add some toggle buttons to this window to do some other tasks(send commands to the mud, enable/disable triggers or classes). I've come to an issue I couldn't find a solution to. When I do something like:
Code: |
#execwin MainWindowNameHere { #whatever } |
the command doesn't go through to the main window. Is this not supported? Is there a workaround?
Also, if I want to have a button in this second window enable/disable a trigger or class in another window, how do I reference that trigger or class? Is it //MainWindow/Triggers/ExampleTrigger like with variables? Or is it not possible? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Apr 09, 2012 11:34 pm |
Only variables are visible from outside the window, I believe (if not, yes, they would be referred to in the same way).
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Apr 10, 2012 12:06 am |
I think another option is to use events. I think that a raised event can be seen by all windows.
|
|
|
|
tehpopa Newbie
Joined: 01 Jun 2011 Posts: 4
|
Posted: Tue Apr 10, 2012 2:44 am |
Rahab wrote: |
I think another option is to use events. I think that a raised event can be seen by all windows. |
I just tried that but it seems to be a no go. Thanks though. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Apr 10, 2012 4:25 am |
#RAISE is affected by context. If the #RAISE occurs in a window that has no visibility towards a particular package, then events in that package will not be aware that #RAISE was called and therefore will not fire.
Tehpopa, give us some real code to look at. #EXECWIN is in fact a way to use zscript commands in other windows, but there might be focus/context issues (used to be a bug wherein #execwin wasn't working correctly with window context, but I can't remember if that got fixed). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|