sigslots and classes help?

Jeremy Lawrence <[email protected]> Sat, 27 Aug 2005 08:44:02 -0500
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <[email protected]>
Hello,
   After running up against some problems getting the signals and
slots to work for me I've created a test file that will hopefully help
explain things.  I've looked through the js file and have been
stepping through the code using the mozilla debugger with no luck in
figuring out what I'm doing wrong...What I'd like to do is trigger
methods within a class, for some reason I can't seem to do much more
than attach to the class in general and use a constructor to get into
the function I want.  While this works it complicates things if I can
only go through the constructor method.  Thanks for any help you can
give.

--jeremy
--------------
using Netwindows v0.4.0pre6
and Mozilla 1.7.11
------example code-------
...
   	<script language="JavaScript" type="text/javascript"
src="./netwindows/winScripts/netWindows.js"></script>
  </head>
  
  <script languate="JavaScript">

       function funcA(){
          document.write("<br>in funcA");
       }

       function funcB(){
          document.write("<br>in funcB");
       }
       function classfunc(){
          this.funcC = function(){
             document.write("<br>in classfunc()--> funcC");
          }

          this.funcD = function(){
             document.write("<br>in classfunc()--> funcD");
          }
          
          this.funcC();
       }

       __sig__.connectByName(null, "funcA", null, "funcB");
       __sig__.connectByName(null, "funcB", null, "classfunc");    //
<-- works this way....using constructor this.funcC();

// I'd like to have funcB() trigger funcC() and funcC() trigger funcD,
I'm under the impression // that I should be able to use:

       __sig__.connectByName(null, "funcB", classfunc, "funcC"); 
       __sig__.connectByName(classfunc, "funcC", classfunc, "funcD"); 

// However, the funcC() and funcD() are never triggered for me? Or
only funcC() is if I use the
//constructor...


 </script>
<body>
<script languate="JavaScript">

document.write("In Body");
document.write("<br>Calling funcB()");
funcB();
document.write("<br>In Body");
document.write("<br>Calling funcA()");
funcA();
document.write("<br>creating fa = new funcA() to see what happens");
fa = new funcA();
document.write("<br>End");
document.close();

</script>
...
--------end code-------------

_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org