Localising ⎕WX within a Form-based class
4 posts
• Page 1 of 1
Localising ⎕WX within a Form-based class
Setting a local value of ⎕WX within a form-based class seems insufficient to expose the form's properties.
Localising ⎕WX to the methods makes no difference. It is as if the effective value of ⎕WX is the root value in the root, not the namespace value.
Something I'm missing?
)ED ○ Gui
:Class Gui: 'Form'
∇ make0
:Access Public
:Implements Constructor
⎕WX←1
Caption←'Gui'
∇
∇ r←ReportWX
:Access Public Instance
r←⎕WX
∇
:EndClass
⎕WX←1
g←⎕NEW Gui ⍝ form Caption is 'Gui'
g.ReportWX
1
⎕WX←0
g←⎕NEW Gui ⍝ form Caption is empty
g.ReportWX
1
#.APLVersion
Windows 14.0.21763.0 W Development
Localising ⎕WX to the methods makes no difference. It is as if the effective value of ⎕WX is the root value in the root, not the namespace value.
Something I'm missing?
- sjt
- Posts: 21
- Joined: Fri Nov 05, 2010 6:26 am
Re: Localising ⎕WX within a Form-based class
You are correct: It is the value of ⎕WX in the environment where an object is instantiated which decides the behaviour; the rationale being that this switch controls "how the object will look from there". Once the object is created, setting ⎕WX inside it only controls the behaviour of any objects that it in turn creates.
One possible work-around for this would be to wrap your classes in a namespace:
For the record, Dyalog strongly recommends using the default ⎕WX of 3 and not modifying it, if at all possible.
P.S. I can see that the F1 help for ⎕WS could do with clarification, at the moment it can be read as the exact opposite of what was intended.
One possible work-around for this would be to wrap your classes in a namespace:
- Code: Select all
:Namespace WX1
⎕WX←1
:Class Gui : 'Form'
...
:EndClass
:EndNamespace
For the record, Dyalog strongly recommends using the default ⎕WX of 3 and not modifying it, if at all possible.
P.S. I can see that the F1 help for ⎕WS could do with clarification, at the moment it can be read as the exact opposite of what was intended.
-
Morten|Dyalog - Posts: 453
- Joined: Tue Sep 09, 2008 3:52 pm
Re: Localising ⎕WX within a Form-based class
Further research reveals that I haven't got that QUITE right; you CAN change ⎕WX for a "real" GUI object. However, I suspect that setting ⎕WX in the derived class does not impact ⎕WX in the base class - you can only decide that once, by having the right ⎕WX when you perform the instatiation.
-
Morten|Dyalog - Posts: 453
- Joined: Tue Sep 09, 2008 3:52 pm
Re: Localising ⎕WX within a Form-based class
... And it looks as if my work-around doesn't work either, sorry about that. I think I should take a couple of days off and have a chat with a couple of experts here before I continue.
Merry Christmas to those of you who celebrate it - and a Really Good Rest of the Week to everyone else!
Merry Christmas to those of you who celebrate it - and a Really Good Rest of the Week to everyone else!
-
Morten|Dyalog - Posts: 453
- Joined: Tue Sep 09, 2008 3:52 pm
4 posts
• Page 1 of 1
Return to Windows: GUI, COM/OLE/ActiveX
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group