EventHandler, event, delegate based programming in Python any example would appreciate?
Basically I'm a C# developer, I know the way C# does, EventHandler, delegate, even... but whats the best way to implement it on Python. ...
Basically I'm a C# developer, I know the way C# does, EventHandler, delegate, even... but whats the best way to implement it on Python. ...
When I click minimize button in my Windows Forms application, I don't want it to perform the classic Windows minimize animation (window going down to taskbar). As far as I know, there's no Minimize event, I can just use Resize, but I have no clue how to detect if I clicked minimize button. I tried to use if ( WindowState = FormWindowSta...
I have a LinkButton inside a GridView (via an TemplateField). No matter what I try, the LinkButton will not invoke its event handler. I have tried both: A traditional event handler ("OnClick") A OnRowCommand event handler at the GridView level. In both cases, I've debugged and it doesn't even catch the event handler. If I move the...
Inspired by this Flex question, is it seen as better practice to dispatch an event back to the parent app, as opposed to calling a method on the instance of the parent app, from within a module? To me it seems that the module shouldn't know what methods are available at the parent, as such approach leads to tight coupling. Thoughts? ...
I'm trying to populate a mx:tree component with values that I'm getting from BlazeDS. The returned data from BlazeDS is fine - it's an ArrayCollection of Folder value objects. I've been instructed to use Cairngorm for this project. I'm pretty new to Flex and Cairngorm. According to the limited documentation that I've read online I shoul...
Hello. I have a ViewController which has a button that when is pressed adds a subview from nib. I have this action: - (IBAction) addTooltip { if (self.tooltip == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Tooltip" owner:self options:nil]; self.tooltip = [nib objectAtIndex:0]; self.tooltip.fra...
A Subject-Observer relationship isn't a dependency relationship: Observers don't need Subjects in order to exist, and vice versa. Yet the "wiring together" of publishers and subscribers is strongly reminiscent of Dependency Injection. My shoot-'em-up game makes extensive use of the Observer Pattern. For example: A controller object spa...
I am creating a custom control and i want to add some properties in it. On few of the properties i want to create some events. Say if i have a property public int Date {get; set;} now if its value is changing i want to trigger a change event. SO how can i add event on this ...
Hi folks ! I'm trying to design an application (in C++ but that doesn't matter I guess, anything object-oriented would work the same) which has to synchronize a bunch of events together. Basically, you would have a several data structure instances which would contain lists of events. An event would have a timestamp and be "runable". T...
Hello, I created a component based on a JPanel that contains a textfield and a checkbox. Since I use it as component and put it around in other panels I'd like to be able to set a KeyPressed event for the panel. Obiouvsly this doesn't work as the keyPressed events fire for the inner textfield. Is it there a way to propagate them to the J...
I have a text box (dynamic) whose value is being changed by javascript using the setVariable method. Bascially I'm now stuck in getting the flash application to recognise when the text box value has been changed, onKeyUp etc.. do not seem to work. The below code works if the user types in to the box, but if it is changed via JS it doe...
Hi, I have a flash app, that redirects to another page. I'd love to trap any other window unload event (clicking links / submitting forms) and warn the user they'll lose their progress in the Flash app. However, I can't find any way to tell that the click/change of URL/window unload was triggered by Flash vs being triggered by a normal ...
I have a Windows.Forms app with a ListBox populated with Account objects. When the user selects an Account from the list I attach an EventHandler responsible for updating the selected Account transactions in the event that there's any new ones while the user is looking. private void listBox1_SelectedIndexChanged(object sender, EventArg...
I have two forms and I am trying to capture an event generated from frmEventGenerate.cs in frmEventReceive.cs. In this example I can receive the event from frmEventGenerate.cs but not sure how I can catch this in frmEventReceive.cs? frmEventReceive.cs is my startup form which creates frmEventGenerate.cs. Can someone point me in th...
Hi folks, in my C#-Silverlight-3-Application, I have created a class, that is doing some calculations that are used in different parts of my program. This class needs data from a database, so it calls a WCF-Service to get the data. The structure of the class looks like this: public class ConsumptionCalculation { // Declare the event...
I have a number of C# custom events that are associated with items being selected in a tree and then a context menu being used to trigger some action on the selected items. I started creating a separate EventArgs-based class for each custom event, to package the necessary data for the event. In hind-sight though, I realize that most ...
I am trying to get JQuery events to work with partial views in ASP.NET MVC. However, after you load a partial view through Ajax, JQuery seems not able to fire events for any of the elements in the partial view. I suspect that this issue will also happen if you are using other frameworks or JavaScript libraries to load partial html code w...
I want to acces alarm. in my application i have successfully accessed calender and have set the appointment but how i can access alarm. please help me. following is my code public class Alarm { private Event event; public void myAlarm() { try { EventList eventList = (EventList)PIM.getInstance(). ...
I have hyperlinks, all are named 'mylink'. They should all fire the same event, but only the first element named 'mylink' actually fires. My code is as follows: $(document).ready(function() { $("#formID").validationEngine() $('#mylink').click(function(e){ var goto = $(this).attr('href'); //get the url ...
The following declaration at the window level: var event; // for IE var event = "anything"; // for Chrome will destroy the event object as used here: <div onMouseOver = "alert(event.type);">Mouseover Div</div> Firefox does not seem phased by either declaration. I realize that declaring a variable with the name "eve...