event-handling

Hooking a GWT event onto an element in an external iframe

Hi everyone, I am writing a GWT app that involves interacting with an external document in an iframe. As a proof of concept, I am trying to attach a click handler to a button. The following works in javascript var iframe = document.getElementById("rawJSIFrame"); var doc = iframe.contentDocument; var body = doc.body; var button = doc.g...

WPF: Asynchronous progress bar

I'm trying to create a progress bar that will work asynchronously to the main process. I'm created a new event and invoked it however everytime I then try to perform operations on the progress bar I recieve the following error: "The calling thread cannot access this object because a different thread owns it" The following code is an at...

Initiate onclick faster than with document.onload

I have html-pages with links where i want to attach a function to their onclick-event. One way to do it is of course: <a href="save.php" onclick="save(); return false;" rel="save">Save</a> But I know this is not the best practice. So instead I wait for window.onload, loop through the links and attach the save-function to the links wit...

Why do exceptions propogate out of an event handler?

Consider the following program. How is the behaviour that it displays (namely that exceptions will propagate out of an event handler) a "good thing"? As far as I can tell, it could only ever be bad; unexpected exceptions popping up from functions that they shouldn't. In my particular case, it was killing threads. So, is this behaviour ac...

Detecting Flash "Click" Event in JavaScript Across Browsers

Is there a way JavaScript can detect clicks (or mousedown, mouseup) that happen on Flash objects? I have tried: Attaching the 'mouseup', 'mousedown', and 'click' events to the Flash object using attachEvent/addEventListener Directly attaching the 'onmouseup', 'onmousedown', 'onclick' events inline on the Flash object Switching from ev...

handling events of controls (ON USER CONTROL or WEB PART) added during runtime

I used to have some controls added dynamically through runtime on an ASP.NET webpage and was able to handle their events but now I put the code in a user control but it doesnt work. Any idea? while (drr.Read()) { LinkButton lnkbtnDownloadFile = new LinkButton(); //name of the file ---> drr[2] lnkbtnDownl...

SWT, Maintain default tab ordering when adding Key Listner

I've been creating a custom TabFolder extension that adds a key listener to allow quick tab switching using an ALT + # hotkey. By adding the KeyAdapter to my TabFolder, the event handler works properly only when you have a tab header selected (in which case the ALT + ARROW_LEFT/ARROW_RIGHT also work.). I need this hot key to be active w...

Z order and event handling wpf

Hi, This is a follow up to my question here. It seems that even though the InkPresenter is closest to the user, the MouseDown/MouseMove/MouseUp events are received by the Image element. Does anyone know why that is? Edit: Sorry if I didn't make the question clearer: I have attatched event handlers to the InkPresenter, which is a sibl...

How to rebind datagridview when user moves from one cell to another?

I have a datagridview where the first cell is used to retrieve data for the grid. If I use the cellleave event to rebind the grid to a datatable, I get a "Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.", which makes sense. Where can I bind the grid to a datasource after all the e...

How to stop a process with time constraints

I think the topic might not be accurate enough, but I really don't know how to describe it in a very brief way... What I want to do is as follows: I have a process running some analysis (in Java) and trying to give a return value, but the whole analysis has a time constraint, say 10 seconds If the analysis gives a result within 10s, ...

Why base parameters to custom EventHandlers from EventArg

From How to: Publish Events that Conform to .NET Framework Guidelines Although events in classes that you define can be based on any valid delegate type, even delegates that return a value, it is generally recommended that you base your events on the .NET Framework pattern by using EventHandler, as shown in the followin...

Flex 3 event propagation on a composite custom component?

I have a custom component made up of a selectable control (radio button) and a text input. I want to perform some logic in response to the change events from both of those controls, but after that I want anything that is registered on the composite component's change handler to have a change to handle the events as well. The problem is...

AS3: Model and View Communication in a Game

So I'm attempting to use the MVC pattern for a game I'm working on. Everything has been going pretty smoothly so far, but I'm having trouble figuring out how to get my model and my view to talk to each other effectively. My general model structure involves lots of nested information. a Level has Rooms a Room have Layers a L...

event-listeners in horizontalLists

How do add event listeners to individual objects in the horizontallist. If i add event listeners to the object before adding it to the list, the event listener is not being called. How do i implelment this? ...

How to get events to be handled in a particular order in C#?

I had this idea of registering an event in a base custom page on every button. I can check if it was a save or edit and then do an authorization and validation. Derived pages would still handle the click event to do the specifics for saving on that page. I wasn't sure which events would happen first. (but it probably is in order of w...

How can I execute an external function when an element is clicked?

I'm trying to execute an external function on click of a DOM element without wrapping it in another function. Say I have a function called sayHello(), as follows: function sayHello(){ alert("hello"); }; To execute it on click, I currently have to do this: $("#myelement").click(function(){ sayHello(); }); Notice I am forced to ...

Event Handling For Toolbar Using Haxe Targeting Flash

I am creating a simple UI toolbar component in Haxe for use in a Flash game. The toolbar is your general UI style toolbar, it has a background and several buttons. When the buttons are clicked some game action happens. I have a question about the best way to implement events for the toolbars buttons. A parent class will create a toolbar...

Application / MVC Event Model

Update: This question was inspired by my larger quest for mapping ontologically the whole software systems architecture enchilada. I've written a blog post about it, and hopefully it will help clarify what I'm after. Many, many, many frameworks and stacks that's event-driven have too much variation for my little head to get around. Is...

Need help with Anroid TrackBall Event

I have 2 questions about android TrackBall Event. I appreciate if you can help me with them: Can I detect the speed of TrackBall event? like in Fling, I can detect a 'big' fling vs a 'small' fling. Can I fling via the track ball? Why TrackBall Event always follow by Key left/right events? To me, they seem duplicate. For example, I p...

Flash AS3 Best way to communicate independent classes?

Hello, what would be the simpliest way to communicate between independent classes? I have been searching for two days and couldn't find nothing, isn't there a way that one class has a dispatchEvent and the other an addEventListener, with a custom Event?? I could only find solutions within the same class o with a parentchild relationship,...