Hi everybody, The existing event system which can be attached to a "global/central" point - be it window.application or whatever already delivers already exactly what everybody is calling for. For example, enabling or disabling a whole set of "paste" buttons - in the menubar, in the context menu, whereever - you just need to add a
window.application.addEventListener("enable-paste-button",function(e){myCurrentButton.setEnabled(e.getData))}); or, in PHP QxBuilder (Christoph, it would be better if you called your project differently because you're implementing something very different to the existing QxBuilders): <qx:menuButton label="Paste" icon="icons/16/edit-paste.png" enabled="false" enableOnGlobalEvent="allow-paste"> <qx:command onExecute="bg_references_list.handlePaste()" /> </qx:menuButton> The clipboard code doesn't need to know about how many paste buttons are out there, it just need to dispatch window.application.createDispatchDataEvent("allow-paste", true/false); in order to achieve the desired effect. Wrapper functions can make the code less inelegant. A new solution would be fine - but for folks who still work with the 0.5.x branch, there is everything you need already there... Christian Sebastian Werner schrieb: > Hi! > > Also interesting is some global communication layer. > > In my opinion we need both, something to communicate in *one* > application. We don't want to use hard connections here. We want to make > this application or part as flexible as possible. > > After this we need some application/part communication. Something like > dbus (http://www.freedesktop.org/wiki/Software/dbus) for javascript > would be helpful in my opinion. > > Generally each system you use, produce some overhead compared to not > using it at all. The best would be to use simple function calls in > high-performance areas. The creation of the event object is the first > thing what is needed to do more in this case, compared to simple > function calls between different objects. But it's OK to use this system > in about 90% of the use cases I think. > > Sebastian > > > > > Christian Boulanger schrieb: > >> Hi, >> >> I am currently converting my app away from using objects which call each >> other's methods to for some behaviour to objects which communicate which >> each other through global events >> (window.application.createDispatchEvent("foo"), >> window.application.createDispatchDataEvent("foo", {blub:true}, >> window.application.addEventListener("foo", function(e){....}), and am >> very much intrigued by the idea. Advantages include that I do not have >> to give objects names in the global namespace or in an object registry. >> All objects just exist independently and listen for each others events >> to react to them (or not). All the behaviour code is located at the >> object level - it is also easier to keep the application stable because >> missing or broken functions cannot break it. I am thinking of extending >> the system to include client-server communication. >> >> Since the idea seems so nice to me, I wonder what the drawbacks might >> be. Do you expect a major performance loss? >> >> Thanks for any input, >> >> Christian >> >> All the advantages of Linux Managed Hosting--Without the Cost and Risk! >> Fully trained technicians. The highest number of Red Hat certifications in >> the hosting industry. Fanatical Support. Click to learn more >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 >> _______________________________________________ >> qooxdoo-devel mailing list >> qooxdoo-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >> > > > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel