events

Why does C# require you to write a null check every time you fire an event?

This seems odd to me -- VB.NET handles the null check implicitly via its RaiseEvent keyword. It seems to raise the amount of boilerplate around events considerably and I don't see what benefit it provides. I'm sure the language designers had a good reason to do this.. but I'm curious if anyone knows why. ...

click event does not fire when coupled with css :active

I have created a navigation menu where, when clicking on a link, a jquery dialog box opens. On these same links in my css I have: .navigationLinkButton:active { background:rgb(200,200,200); } The dialog box is attached simply with: $("#link").click(function() {$(this).dialog("open")}); Occasionally (about every 4-5 clicks) when a us...

How can I determine if an event was fired by a user action or by code?

I have a bunch of controls on a form and all of their "change" events point to the same event handler. Some of these are txtInput1's TextChanged, chkOption1's CheckedChanged, and cmbStuff1's SelectedIndexChanged. Here is the event handler: private void UpdatePreview(object sender, EventArgs e) { // TODO: Only proceed if event was fi...

How do I register a JS function to run when a browser window is resized ?

How do I register a JS function to run when a browser window is resized ? I assume it's in the Page.ClientScript class methods somewhere, but I am a bit confused. ...

JEditorPane onReady?

how can I perform an action when the JEditorPane is done loading a webpage from an url? is this even possible? i'm unable to find anything about this online :s thank you ...

Detect Any touch Event across Application in iphone

My objective is to detect any touch event inside My Application on any view... (i.e Inside my application any touch event in anywhere should be detected...) I have tried it by subclassing my appDelegate Class with UIApplication but it is giving me error http://stackoverflow.com/questions/3101345/how-to-detect-idle-user-in-iphone-sdk h...

Hide JDialog window when the window lost focus.

Hi I have only one JDialog box in my Java application.I want to make it invisible if it lost the focus. I've tried different method, But didn't able to trigger any of the window focus events. Here is my code: public void windowGainedFocus(WindowEvent e) { System.out.println("gained focus"); } public void windowLostFocus(Windo...

Javascript overwrite events

I have a few elements with a click event: $$('.set_main').invoke('observe', 'click', set_main ); And i want to change the event observer. My question is, do I have to remove the event listeners first with something like: $$('.thumb').each(function(item) { Event.stopObserving(item, 'click', set_main); }); or can i simply overwri...

wxPython taskbar icon events don't work as expected

Using wxPython (I am completely new to it), I have created a taskbar icon based on the wxPython demo code. The icon's menu opens upon rightclick of the taskbar icon. However I would want it to do something specific on left click as well. I've tried implementing this by listening for the EVT_TASKBAR_CLICK event, as in the 3rd Bind line i...

How can a function be triggered with an event?

I have an application wherein I would like a function to be executed in the same thread when an event is fired. For example: SomeCode() { // Do something... // Fire event to run SomeOtherCode(). } SomeOtherCode() { // Do something else... } I do not want to simply call the function because it will hold things up. SomeOthe...

Disabling/re-enabling interactivity

Hello, As an AS3 beginner, I'm trying to translate an old AS2 trick into AS3. I want to disable then re-enable any kind of interactivity with all the display objects on the stage, at once. For example while waiting for external assets to load or after a user clicks on a menu item. This what I used to do with AS2 : protect_mc.onRelease...

How to detect smartcard insertion or removal event in linux

Folks, I'm working on a certificate authentication app that will authenticate user based on CAC inserted. How do I know when the CAC is inserted / removed? I'll be "catching" that event in C++ or Java. Thanks. ...

Raising events in C# that ignore exceptions raised by handlers

One of my pet peeves with raising events in C# is the fact that an exception in an event handler will break my code, and possibly prevent other handlers from being called, if the broken one happened to get called first; In most cases my code couldn't care less if somebody else's code that's listening to its events is broken. I created a...

Registering with a URL for asynchronous notifications?

I am trying to understand more about async notifications. I have a URL in the form of: http://www.sample.com/AsyncNotify?sessionId=xxxxxx Now if I call this URL with the sessionId, it is equivalent to registering for Asynchronous notifications. I am using Apache HTTP Commons library to do Http Post and Get. If that's the case, then ho...

Should event handlers in C# ever raise exceptions?

As a general rule, are there ever any circumstances in which it's acceptable for a method responsible for listening to an event to throw an exception (or allow to be thrown) that the class raising the event will have to handle? Given that such an exception would stop other listeners to that event from being called subsequently, it seems...

What is the required visibility of an action method in iphone responder chain?

In a UIViewController subclass I create a bar button item that fires an event up the responder chain: UIBarButtonItem* editListsButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:nil action:@selector(edit)]; self.navigationItem.leftBarButtonItem = editListsButton; [editListsButton release];...

Scalable, Delayed PHP Processing

I'm working on an online PHP application that has a need for delayed PHP event. Basically I need to be able to execute arbitrary PHP code x many seconds (but it could be days) after the initial hit to a URL. I need fairly precise execution of these PHP event, also I want it to be fairly scalable. I'm trying to avoid the need to schedule ...

How to fire event by using Xcode?

Hi all, I want to develop an iphone app which communicate with the hardware by using tcp/ip. Now, the app send to the hardware is ok. For the convenience to develop, i want to use fire event to develop the receiver. Does anyone has any ideas? Joe ...

How to distinguish Unload Event triggered by Refresh or Window Close?

Unload Event can be triggered both by Refresh action and Window Close action. is there a way to distinguish which action that actually trigger it? In my situation, i want to ignore the Refresh action. Could you please give me some insight what the work around is? I noticed that there is already this sort of question asked, but it seems ...

How to detect Iframe paste event by right mouse click in IE, FF, Safari?

This might be a stupid question or easy questions for some people. I have code to detect paste by ctrl-V key but not paste by right mouse click. But I am looking for some clue on how to do it. Thanks for helping ...