Re: Devel Digest, Vol 24, Issue 1
"Michael Franklin" <[email protected]> Mon, 29 Aug 2005 09:00:00 +1200
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <74D0039691DD1A4DA59C4D13CA21CD990B8ACE@akl-exbe001.corp.peace.com> |
You need to declare an instance of classFunc, and connect to that, not the 'class' definition > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of [email protected] > Sent: Sunday, August 28, 2005 5:00 AM > To: [email protected] > Subject: Devel Digest, Vol 24, Issue 1 > > Send Devel mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://netwindows.org/mailman/listinfo/devel_netwindows.org > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Devel digest..." > > > Today's Topics: > > 1. sigslots and classes help? (Jeremy Lawrence) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 27 Aug 2005 08:44:02 -0500 > From: Jeremy Lawrence <[email protected]> > Subject: [NW-Devel] sigslots and classes help? > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > 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------------- > > > > ------------------------------ > > _______________________________________________ > Devel mailing list > [email protected] > http://netwindows.org/mailman/listinfo/devel_netwindows.org > > > End of Devel Digest, Vol 24, Issue 1 > ************************************ _______________________________________________ The netWindows developers list: [email protected] http://netwindows.org/mailman/listinfo/devel_netwindows.org