events

How should I implement a "quiet period" when raising events?

I'm using a subscriber/notifier pattern to raise and consume events from my .Net middle-tier in C#. Some of the events are raised in "bursts", for instance, when data is persisted from a batch program importing a file. This executes a potentially long-running task, and I'd like to avoid firing the event several times a second by impleme...

How to scroll an inactive Tkinter ListBox?

I'm writing a Tkinter GUI in Python. It has an Entry for searching with a results ListBox below it. The ListBox also has a Scrollbar. How can I get scrolling with the mouse and arrow keys to work in the ListBox without switching focus away from the search field? IE I want the user to be able to type a search, scroll around, and keep typi...

ListBox dosn't fire OnSelectedIndexChanged event when SelectedIndex is changed

I have an asp.net page with a list box on it. Multiple event handlers subscribe to its OnSelectedIndexChanged event. When I change the SelectedIndex programmatically none of the events get fired. Now a hack for this is to call each event handler, but this has already caused bugs since people didn't know they had to do this when adding ...

Adding EventHandler according to a Type

I have list of objects that contain information about which classes static EventHandler should be listen to whitch folder. I know this doesn't work but you'll get the idea.. (eventhandler doesn't have to be static, class can also be a singleton, but somehow I have to add an EventHandler based on the type specified) foreach (Service s i...

AS3 TextChange Event?

Hello everyone, I just want to know if there is any TextChange Event or equivalent to that in AS3? I am currently using Adobe Flash CS3 with my AS3 files and I have to detect whether or not my TextTool's value has changed or not. With my data being integers ranging from -4.440 to 3.560, I obviously cannot use the != operator. If anyo...

How to sink COM events from Silverlight?

I want to raise an event from a .NET class, and receive this event in Silverlight code (out-of-browser, using the COM interop support added in SL4). Can anyone point out the problem in my code? Do I maybe need to do more attribute-decorated interface boilerplate to get this working? Code: Rather than write native COM code, I am writin...

jquery clone doesn't seem to retain draggable/droppable events

Hi there, I have a row where I can drag items into it, and sort them. This all works ok. I even have a delete event on each item, so it can be removed from the row. I want an option where I can clone the row. I do this by using the clone function below: clonedrow = $("#row1").clone(true); clonedid = "row"+nextRowNumber; //nextRowNumbe...

loading a function onclick

Hello. I have the following piece of code <a onclick="$('#result').load('codes/test.html');$('#result').show();" >XHTML code</a> it loads perfectly the content of test.html in the result div and also make it visible. Until this point all are good. When I try to add a function prettyPrint() which apply some modifications on the text an...

Rx - can/should I replace .NET events with Observables?

Given the benefits of composable events as offered by the Reactive Extensions (Rx) framework, I'm wondering whether my classes should stop pushing .NET events, and instead expose Rx observables. For instance, take the following class using standard .NET events: public class Foo { private int progress; public event EventHandler Pr...

onkeydown crossbrowser on IFRAME?

Hello, before to post i try to search a solution in this site and by google but with now luck. I have a issue with IE8, this code below add on the fly an IFRAME and work fine in Chrome, Firefox and IE7. The problem is the keyHandler() function that is not triggered only in IE8. What is the best solution to attach an event crossbrowser...

What is window.eventReturnValue?

I came across window.eventReturnValue on a couple of web pages today (see the second-to-last line of third yellow box in this example). It's not something I'd ever seen it before. What browsers use it? EDIT: Thanks to Tim Down for pointing out that I was misreading a typo on the linked example. ...

Cross-browser event handling

I need a cross-browser function for registering event handlers and a (mostly) consistent handler experience. I don't need the full weight or functionality of a library such as jQuery, so I've written my own. I believe I've accomplished my goals with the code below, and so far my testing has been successful, but I've been staring at it fo...

Events handling with generic handlers in java

Hello I have written custom dispathing/handling event system that generally look like this: Event handler interface: public interface EventHandler{ } Base event class: public abstract class Event<H extends EventHandler> { public static Class Type<H> { } public abstract void dispatch(H handler); } Handler manager: public c...

how to unbind all event using jquery .

i can use this code to remove click event, $('p').unbind('click') but , has some method to remove all event ? has a method named unbindAll in jquery ? thanks ...

WPF, update TextBlock when CheckBox checked

I have a TreeView where each item has a checkbox. I want a TextBlock to be updated whenever an item is checked or unchecked in the TreeView. The TextBlock's Text should be bound to the CheckedVersions property on my DataContext so that when I read the CheckedVersions property, it gives me a string representing all the checked items in ...

Click two new points and draw a line between those two points using mouse event

Hi, Any suggestions how to create a line by clicking two new points then draw a line between them? I am trying to create a distance tool like the one in adobe acrobat. Image Example ...

Shift+Click Event Woes

Hi there! I'm sure i'm doing something terribly stupid for this not to work, but I can't get my shift event to fire. I've tried both: $('.ShowCannedReport_UserFilterDropdown').each(function (index, element) { $(element).bind('click', function (event) { if (!event.shiftKey && !event.ctrlKey) { ShowCannedReport_Us...

Update web form using custom events.

I have 2 buttons on page, where button1.visible = false. Page code behind: protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { Class1.ShowButtonEvent += new Class1.ShowButton(Show); } } public void Show() { Button1.Visible = true; } protec...

What is the difference, if any, between event handler and event listener ?

We read here and there, event handler, event listener... event handler/listener... object handler... it's a mass confusion that a newbie like me can't tolerate. Anyone to clarify this question: What is the difference, if any, between event handler and event listener ? Thanks a lot, MEM ...

How to avoid recursive triggering of events in WPF?

I am having two WPF (from the standard set) widgets A and B. When I change some property of A it should be set on B, when it is change in B it should be set on A. Now I have this ugly recursion --> I change A, so code changes B, but since B is changed, it changes A, so it changes B... You have the picture. How to avoid this recursion t...