mIRC Home    About    Download    Register    News    Help

Print Thread
#231791 04/05/11 12:34 AM
Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Using /did -f on a tab control inside the init event results in weird behavior, the specified tab doesn't have the focus and is locked until you activate another tab:

Code:
dialog test {
  size -1 -1 200 200
  tab "", 1, 10 10 100 100
  tab "", 2
  button "", 3, 10 150 30 15 
}
on *:dialog:test:init:0:{
  echo -a init test
  did -f test 2
}
The first tab will be in focus instead of the second, you can't activate that second tab until you click inside the first one (on its "titlebar")


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2009
Posts: 24
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2009
Posts: 24
If you add a timer of 1 second then it will go to the tab you want.

Code:
.timer 1 1 did -f test 2

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Originally Posted By: Scakk
If you add a timer of 1 second then it will go to the tab you want.

Code:
.timer 1 1 did -f test 2


a 0 second delay would do the same without the pause, but that doesn't mean this isn't a bug :P

confirmed on Windows 7 Basic. looks as though mIRC is only half-activating the tab.


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Jul 2006
Posts: 4,150
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Another related problem, calling $input inside the init event will display the $input dialog before the custom dialog, again, a timer solve the problem..

For this one, if the problem isn't easy to solve, maybe $input could report an error (* $input: cannot use in an event) for consistency since calling a timer is the way to bypass this.

Edit: in fact it's not related to $input, the dialog window is just not visible until the init event is done, which looks like intentional

Last edited by Wims; 16/05/11 12:38 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 214
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
Using the -m switch for /timer will solve it so far, you won't notice it that there was a timer anyway. wink

Code:
/timer -m 1 1 did -f test 2


It's not really 0 seconds but it acts almost like it.


one step closer to world domination
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
Originally Posted By: Sephiroth_
Using the -m switch for /timer will solve it so far, you won't notice it that there was a timer anyway. wink

Code:
/timer -m 1 1 did -f test 2


It's not really 0 seconds but it acts almost like it.


If you didn't know, you can just make a timer with an actual 0 second delay, like jaytea already hinted at.

Code:
/timer 1 0 did -f test 2

Joined: Oct 2003
Posts: 214
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
I misunderstood something, just ignore my post. :p


one step closer to world domination

Link Copied to Clipboard