event-handling

Web services, handling server events on the client

Hi all, Had a look over SO but I can't see any threads which address my problem. I have a conceptual architecture, where there is a central server, which allows clients to connect to it via XML web services. There are 2 types of client, producers and consumers. The system is built in C# using WCF WebServices, specifically IIS webservi...

Good way to add event handlers?

I'm making a Gui API for games. Basically I have event callbacks in my class which are function pointers. I thought of directly letting the user = the function pointer ex: widget->OnPaintCallback = myPaintFunc; But I don't like how I cannot check for NULL or do anything else. It also makes my class feel exposed. I also thought of hav...

How to handle single JavaScript events intuitively?

Hi, I often need to create single events that are not needed after they have run once. The way I do is something like: A.prototype.someMethod = function () { var me = this; this.onWindowMouseUpFunction = function () { me.onWindowMouseUp.apply(me, arguments); }; window.addEventListener('mouseup', this.onWindowMou...

Seperate event listener for every textview in android

I want to add separate event listener to dynamically created list of textview. The code so far is like this: while (cur.moveToNext()){ TextView tv = new TextView(this); temp = cur.getString(cur.getColumnIndexOrThrow("_ID")); result = "some text"; tv.setText(result); tv.setOnClickListener(new View.OnClickListener() { ...

access to variable within inner class in java

I'm trying to create an array of JLabels, all of them should go invisible when clicked. The problem comes when trying to set up the mouse listener through an inner class that needs access to the iteration variable of the loop used to declare the labels. Code is self-explanatory: for(int i=1; i<label.length; i++) { label[i] = ...

how to add an eventListener to an Object in javascript which will fire when object is manipulated?

Hi, I have a complicated UI structure which is manipulated dynamically, and say I have an ui_state object where i keep user's latest UI states such as which tab was visible, what was inside that tab etc. For instance: var ui_states = { tabs : [ { name : "some tab", active : true, children : { ... } }...

javascript onclick event handlers not functioning properly

For some reason, my onclick javascript event handlers are not functioning properly. Here is my markup, script and style: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Quadratic Root Finder</title> <script> document.ready = function() { document.getElementById('calculate')....

How to map Qt Signal to Event in Managed C++ (C++/CLI)

I'm writing a wrapper in .NET (C++/CLI) to be able to use some native C++ Qt code in .NET. How can I map a Qt signal into a managed .NET event, so that when my Qt code fires off a signal, I can bring this forward to the .NET code. My Managed class defines the event, but if I try to use the normal QObject::connect method to hook up to th...

Silverlight 3 closing an user control event

Hi all, I am trying to close all opened listeners using something like : GP.GlobalInfo.CommWCF.serviceClient.GetFilteredMessageCompleted -= new EventHandler<GetFilteredMessageCompletedEventArgs>(serviceClient_GetFilteredMessageCompleted); Since the form is being closed, every listener should be closed as well. (am I right?) Since ...

weird result (java event-handling code)

public void itemStateChanged(ItemEvent event) { if(event.getSource() == doctorBox) { if (doctorBox.isSelected() == true) JOptionPane.showMessageDialog(null, "you are a doctor"); else if (doctorBox.isSelected() != true) JOptionPane.showMessageDialog(null, "you are not a doctor"); } } w...

Unload module event handling in flex

Hi, I am developing an AIR app. In the main app I have a module loader 'mainModuleLoader'. I am creating modules as separate mxml files using the <mx:Module> tag. And I am loading such a module in mainModuleLoader dynamically using actionscript. Everything works fine. For the module which I am creating as mxml files, I would like to kno...

C# - Looking to capture an event when a store is added/removed in Outlook

I am writing an add-in that needs to log when a PST is added/removed via the "Data File Management" menu or through AddStore/RemoveStore. I have been having difficulty on finding documentation on how to capture these events. Advice is greatly appreciated. Thanks, Larry EDIT: Here's my dummy code that's not working: using System; us...

Event handler not firing using AddHandler

I have a form with about 40 checkboxes. Once a checkbox is checked, the div control's property should be changed from "none" to "block" or vice versa. I don't get an error, but the checkedchanged event isn't handled. Here is the markup: <tr> <td class="sectionSubHeader lightgrey"> <asp:CheckBox ID="chkbxCOMAEFund" AutoPostB...

JSpinner Value change Events

How to make the update immediately when the jSpinner value was changed. ChangeListener listener = new ChangeListener() { public void stateChanged(ChangeEvent e) { jLabel.setText(e.getSource()); } }; spinner1.addChangeListener(listener); The code above doesnt change the label text automatically, it required you to click again ...

objective-c touch-events

I've got a set of Images and would like to know which I have touched. How could I implement that ? To be more precise: A "Home-Class" will instantiate a couple of Image-Classes: Image *myImageView = [[Image alloc] initWithImage:myImage]; The image-class looks something like this: - (id) initWithImage: (UIImage *) anImage { i...

Monitoring Keyboard shortcuts in Silverlight

Hi, I have certain Keyboard shortcuts (ctrl+Key presses) in my Silverlight app which I use to do certain actions using Input Bindings. Now I am trying to monitor what are the shortcuts used most often. I do not want to explicitly log when the user invokes a input binding . I want it to be more generic. Now my question has two parts: I...

How do I get the source application from an Apple Event?

When another application asks my application to open files, I need to find out which app is the source, because different courses of actions are taken. In - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames the code is currently: NSAppleEventDescriptor *currentEvent = [[NSAppleEventManager sharedAppleEventManag...

How do I add specific events to newly assigned controls in an Array [c#]

Basically I want to assign events to some controls that are created. I want to update the labels associated with each trackbar when each trackbar is changed (change label1[i] and label2[i] when trackbar[i] changes). I have waded through google and I found that this probably has be done by using delegates. I had a blast using lambda expre...

Event handling for dynamic array of controls

I found this link to handle events for a dynamically created control in vb6 and I tried to use this for my code, but to no avail. Option Explicit Private WithEvents grid(0 To 23, 0 To 23) As Frame How can I get the same functionality for this array of controls? ...

Disconnecting a Raphael element event

I attach an onmouseout event to a Raphael circle element like this: (function(el,iElPos,col){ el.mouseout(function elmouseout(){el.animate({"fill":col,"r":ELEMENT_RADIUS},150); alert("first"); fadeTag(); }); )(c,i,e...