<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello! </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is my first post to this mailing list, and just wanted to start out saying that I've been very much impressed using pas2js so far. I've been following the development for quite some time now, but I've just actually started to try and use the compiler. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've been working on a UI framework since this seems to be something the community could use.</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Here's the repo (it's in the infant stage)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/mr-highball/nyx">https://github.com/mr-highball/nyx</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The idea is to build the UI fluently in code, rather than rely on a traditional form editor. While there are some downsides, I believe the upsides are there too (UI changes can be checked in to git/diff'd, easy to see how things are hooked up, etc...). </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Additionally, I'm building the framework to allow the same code to be used to produce browser apps as well as desktop apps. Because of this I rely heavy on interfaces and creation of objects via factories.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Now... here's my problem</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have this code which is the most basic example I could come up with to debug my library (adding a button)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/mr-highball/nyx/blob/master/test/nyx_browser_test.lpr">https://github.com/mr-highball/nyx/blob/master/test/nyx_browser_test.lpr</a> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
```
<div>var<br>
</div>
<div> UI : INyxUI;<br>
</div>
<div><br>
</div>
<div>procedure BuildUI;<br>
</div>
<div>var<br>
</div>
<div> I : Integer;<br>
</div>
<div> LContainer: INyxContainer;<br>
</div>
<div>begin<br>
</div>
<div> UI := NewNyxUI; <br>
</div>
<div> LContainer := NewNyxContainer; //** Here's the issue **<br>
</div>
<div><br>
</div>
<div> //setup the ui with the demo ui components<br>
</div>
<div> UI<br>
</div>
<div> .AddContainer(LContainer, I) //add a container<br>
</div>
<div> .ContainerByIndex(I)<br>
</div>
<div> .Add(NewNyxButton)<br>
</div>
<div> .Container<br>
</div>
<div> .UI<br>
</div>
<div> .Render();<br>
</div>
<span>end; <br>
</span>```</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Rather than returning my interface on that line (the one above works just fine, and constructs the UI object the same way), an exception gets thrown and leads me to rtl.js (line:687) which looks like this (latest version being used 1.4.20)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
```<br>
<span>for (var id in this){<br>
</span>
<div> if (this.hasOwnProperty(id)){<br>
</div>
<div> //console.log('rtl.intfRefs.free: id='+id+' '+this[id].$name+' $o='+this[id].$o.$classname);<br>
</div>
<span> this[id]._Release();<br>
</span>```</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
and throws, (Uncaught TypeError: Cannot read property '_Release' of null)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This easily could be an issue with my code, but in this case it seems like my reference is getting immediately freed after creation and am having a hard time seeing why. I am debugging in the browser (chrome variant) but still having a hard time spotting the
issue. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I'm going to continue debugging this to see if I can gain some headway, but just didn't know if there were any known issues with</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ul>
<li>interface reference counting</li><li>object creation via metaclasses</li></ul>
<div><br>
</div>
<div>Any insight would be appreciated!</div>
<div><br>
</div>
<div>Anyways, keep up the good work, and I'll be sure to post updates on the library when I have them</div>
</div>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0; margin-bottom:0">-Highball<br>
</p>
</div>
</div>
</div>
</body>
</html>