Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Mar 03, 2006 3:07 pm   

Return focus to main window after using "window:"
 
I'm using a conditional trigger to capture the output from the 'who' command but I first clear the window. That seems to set the focus on that window and doesn't return focus after the trigger stops executing. I've tried several things but they either don't work or they end up sending the 'Empty Scrollback' command to my main window, which is an undesired effect. I've tried using the :window: format, but that too also clears my main window.
Code:
#TRIGGER {^%d players.$} {Captured_Who_List:#MENU {Layout|Empty Scrollback}}
#CONDITION {^??? ~[ * ~] {[GS] |}(%w)*} {
  #CAPTURE Captured_Who_List
  #GAG
  } {looplines|param=40}

What do I need to do to return the focus to the main window?
The capture window was created with this:
Code:
#MAKEWINDOW Captured_Who_List open "scrolling=yes|left=0|top=0|height=15c|persistant|floating|align=top"
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Mar 03, 2006 4:34 pm   
 
Maybe use #CLR instead of the #MENU option?

ie a way to clear all windows:
#FORALL %names {:%i:#CLR}
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Mar 03, 2006 5:08 pm   
 
Alrighty... I just tested that method out (Captured_Who_List:#CLR) and it didn't clear anything on either window. It didn't clear my main window, which is good, but it also didn't clear the Capture window, which is what I was hoping for.

If I click the pin on the title bar (stay on top) the window gains focus when the trigger fires, but sometimes clears my main window instead of the capture window, as if that part was firing before the window gained focus. However, the window name is specified so it should only execute that command in that window. If I unclick the pin the window gets lost behind my main window but doesn't clear my main window ever, but it still doesn't clear the capture window every time. It also ocassionaly misses some lines it should capture if the window isn't in the stay on top mode. It's all very odd and confusing and I'm at a loss as to how to get it to function properly.
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Mar 03, 2006 5:13 pm   
 
Further testing...
Code:
:Captured_Who_List:#CLR

This does clear the window and leaves the focus on the main window, however, it only clears the window if it's been filled enough to cause the window to scroll down. This is better, but still not the desired effect.

Any other suggestions?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Mar 03, 2006 10:19 pm   
 
#WINDOW Captured_Who_List {%concat(%char(27),"[2J",%char(27),"[1;1h")}

Those are the ansi codes to clear the window, and then set the cursor position.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Sat Mar 04, 2006 3:08 pm   
 
That's having the same problems as the #CLR option did. It clears the window only when it's been filled enough to scroll down. It also doesn't return focus to the main window. I think I'll just give up on this project.

Idealy, a status window to hold that information would be a lot easier to work with, but since you can only have one of those and it's ALWAYS on top of EVERYTHING (even the editor window), it's a bit annoying to deal with.

I appreciate all your suggestions.
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Sat Mar 04, 2006 6:21 pm   
 
A quick workaround - send enough blank lines to the window to make it scroll, then send #CLR:
Code:
#60 :foo:#say;:foo:#clr

For what it's worth, #CLR works just fine for me, even if the window has never scrolled.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net