Leaving the Dark Ages with GUI

Writing and using Classes in Dyalog APL

Re: Leaving the Dark Ages with GUI

Postby Maria on Wed Jun 08, 2011 1:29 pm

Morten, I guess my question comes down to--is it intended that forms don't keep a reference to their children and hence children created with []NEW disappear if you don't "catch" them anywhere? Thus, if I use []NEW to create objects that I don't "know" about specifically, which is kind of a big advantage to Dyalog's form creation style over say VB where you create forms in a designer, I need to do the maintenance of the list of them myself. When I used to use []WC and everything had a name, THAT was the reference that caused it to stay around, and I could use []NL to give me a list. It seems you could have chosen for forms to maintain their own internal list of their children and I could ask it for the list. (But then deleting it would be nasty!) What I find interesting about this is that it seems that the fact that I have to create a button using []NEW *inside* of the form the button will sit on should give me some added benefit. It seems the button knows it belongs to the form but the form doesn't know the button exists.

BTW, I misspoke a bit about why I'm changing from []NEW to[]WC. It's not just to be "modern." I've got a set of pseudo classes from before Dyalog 11 that as much as one could do before Dyalog 11 derived from the Dyalog GUI objects. Now I'm moving to do that with real classes instead of using the stuff we hacked together before Dyalog went OO. I don't suppose I could use []WC to create my derived classes, thus giving the object a name?
Maria
 
Posts: 4
Joined: Thu Nov 26, 2009 12:33 pm

Re: Leaving the Dark Ages with GUI

Postby neeraj on Wed Jun 08, 2011 1:45 pm

I would agree with Morten that I find []WC more useful. I believe that if you are doing Complex GUI screens/Operations then []WC is easier and more intuitive. I cannot make a comment on WPF although Prima Facie it appears to be useful.

As a point of comparison although we have ADO and ADO.NET, SQAPL is probably more useful and intuitive to the APL programmer. It is very easy to get lost in the Object hierarchies of the former.
neeraj
 
Posts: 81
Joined: Wed Dec 02, 2009 12:10 am
Location: Ithaca, NY, USA

Re: Leaving the Dark Ages with GUI

Postby Erik.Friis on Wed Jun 08, 2011 4:21 pm

Re Maria's last post. I must admit that I found the necessity of having to create a control within the context of the form it belonged to counter-intuitive. I'd first tried to create them independently (oddly enough the tab control and subform have a mechanism that allows this sort of thing). Also having to maintain a list of of the sub-objects is a bit odd, but seemingly easy enough. I posted some examples, but have not gotten any feedback from anyone yet on them.
Erik.Friis
 
Posts: 66
Joined: Mon Apr 04, 2011 3:16 pm

Re: Leaving the Dark Ages with GUI

Postby Morten|Dyalog on Wed Jun 08, 2011 5:10 pm

Maria wrote:Morten, I guess my question comes down to--is it intended that forms don't keep a reference to their children and hence children created with []NEW disappear if you don't "catch" them anywhere?

Yes, it is intentional that objects created using ⎕NEW disappear if you do not assign the reference to them so something that keeps them alive (how else would you ever get rid of them :-)?). On the other hand, I think it is an oversight that you cannot easily ask for the list of child objects, and we'll take a look at providing this functionality.
Maria wrote:I don't suppose I could use []WC to create my derived classes, thus giving the object a name?

No, this would not work - ⎕WC applies to the old GUI objects only and will not be extended.
User avatar
Morten|Dyalog
 
Posts: 388
Joined: Tue Sep 09, 2008 3:52 pm

Re: Leaving the Dark Ages with GUI

Postby Erik.Friis on Wed Jun 08, 2011 5:55 pm

Morten,

If you look at my Form class a simple read-only property is all that's required to query the subobjects of a form. I'm not sure why Maria feels this is an issue. Since you have to store them anyway (I just use a vector), this can't be much simpler. I suggest if you are interested in enhancing the system then you should add not only the ability to query the sub-objects, but the ability to not have to store them explicitly in a vector as a field.

[quote="Morten|DyalogOn the other hand, I think it is an oversight that you cannot easily ask for the list of child objects, and we'll take a look at providing this functionality.
[/quote]
Erik.Friis
 
Posts: 66
Joined: Mon Apr 04, 2011 3:16 pm

Re: Leaving the Dark Ages with GUI

Postby Vince|Dyalog on Wed Sep 07, 2011 9:29 am

Enhancement 007351 which came into 12.1 and 13.0 last month is this: ⎕WN now also takes a reference as the right argument and in such cases returns a vector of references. So, this could be used to get a vector of references to the children of a GUI object created by ⎕NEW.
Vince|Dyalog
 
Posts: 335
Joined: Wed Oct 01, 2008 9:39 am

Previous

Return to Object Oriented Programming

Who is online

Users browsing this forum: No registered users and 1 guest