|
Post by Walt Decker on Dec 20, 2020 12:12:57 GMT -5
In the help under sending commands: open "My Text Window" for text as #txtWin #txtWin "The fox jumped over the dog." #txtWin "!trapclose [quit]";
should be #txtWin, "trapclose [quit]"
Suggestions:
1. For edit controls, perhaps add an "onkeydown" keyword. That would allow programmers to capture keys such as F0 - F9, Ctl + key, Alt + Key and take appropriate action.
2. For windows perhaps add an "onrefresh" or "onerasebkg." That would allow the coloring of windows with colors other than the built-in colors and perhaps gradient of the window client area.
|
|
|
Post by tsh73 on Dec 20, 2020 14:23:27 GMT -5
No. Why? Without "!" , text goes printed into text area. So you will have in a window
and [ quit ] will not be called on window close.
It is definitely not the thing one wanted.
|
|
|
Post by Walt Decker on Dec 20, 2020 15:37:24 GMT -5
No. Why? Without "!" , text goes printed into text area. So you will have in a window and [ quit ] will not be called on window close. It is definitely not the thing one wanted. Because when I tried it with the "!" in front I received a bad branch message. Because in the samples included with LB PRO the "!" was not included and the "trapclose" was not printed to the window.
|
|
|
Post by tsh73 on Dec 20, 2020 16:09:39 GMT -5
Did you actually HAD that [ quit ] label? Because when I have it, it works as supposed to.
open "My Text Window" for text as #txtWin #txtWin "The fox jumped over the dog." #txtWin "!trapclose [quit]";
wait
[quit] print "trapclose got called" close #txtWin end
cannot say a thing about LB PRO - I have it not.
|
|
|
Post by Walt Decker on Dec 20, 2020 18:17:22 GMT -5
No. However, when I deleted the "!" the trapclose worked both with a lable and with a sub
|
|
|
Post by Brandon Parker on Dec 26, 2020 16:18:26 GMT -5
No. However, when I deleted the "!" the trapclose worked both with a lable and with a sub I suspect you might think it activated because the window itself was closed, but in reality, the window was just closed and the [quit] routine was not activated. If you place a "Wait" statement at the end of the [quit] routine instead of an "End" statement, you will see that when the structure of the TrapClose statement is not correct the [quit] routine is not actually activated on the window close event because it is just simply not set up. Remove the exclamation mark prior to the TrapClose statement below and you will see that the [quit] routine does not activate when the window is closed, and the string "TrapClose [quit]" is simply printed to the #txtWin window. 'NoMainWin Open "My Text Window" For Text As #txtWin #txtWin "The fox jumped over the dog." #txtWin "!TrapClose [quit]"; Wait
[quit] Print "Trapclose was called!" Close #txtWin Wait {:0) Brandon Parker
|
|