Is it possible under any set of circumstances to be able to accomplish this?
My current circumstances are this:
public class CustomForm : Form
{
public class CustomGUIElement
{
...
public event MouseEventHandler Click;
// etc, and so forth.
...
}
private List<CustomGUIElement> _elements;
.....
How do I handle the window close event (user clicking the 'X' button) in a Python Tkinter program?
...
I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start playing again. Is there a way, an event or so to do this ?
...
I am trying to bind an event to a "method" of a particular instance of a Javascript "class" using JQuery. The requirement is that I in the event handler should be able to use the "this" keyword to refer to the instance I originally bound the event to.
In more detail, say I have a "class" as follows:
function Car(owner) {
this.owner =...
What is the difference between this:
this.btnOk.Click += new System.EventHandler(this.btnOK_Click);
and this?
this.btnOk.Click += this.btnOK_Click;
They both work. The former is what Visual Studio defaults to when you use the snippets. But it seems like it only ads extra verbiage, or am I missing something?
...
Suppose I attach an onblur function to an html input box like this:
<input id="myInput" onblur="function() { ... }"></input>
Is there a way to get the ID of the element which caused the onblur event to fire (the element which was clicked) inside the function? How?
For example, suppose I have a span like this:
<span id="mySpan">Hello...
I need a way to modify a value in a table after a certain amount of time has passed. My current method is as follow:
insert end time for wait period in table
when a user loads a page requesting the value to be changed, check to see if current >= end time
if it is, change the value and remove the end time field, if it isn't, do nothing...
When writing GUIs, I've frequently come over the following problem: Assume you have a model and a controller. The controller has a widget W that is used to show a property X of the model.
Because the model might be changed from outside the controller (there might be other controllers using the same model, undo operations etc), the contr...
I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i just have to change the link in the config file.
Problem comes whe...
I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code:
Dim Winsock1 As Winsock 'Object type definition
Sub Init()
Set Winsock1 = CreateObject("MSWinsock.Winsock") 'Object initialization
Winsock1.RemoteHost = "MyHost"
Winsock1.RemotePort = "22"
Winsock1.Connect
Do Wh...
Is it possible to pass a function/callback from javascript to a java applet?
For example i have an applet with a button that when pressed it will call the passed js callback
function onCommand() {alert('Button pressed from applet');}
applet.onCommand(onCommand);
...
Which are the events of an ASP .Net server control and how does their order relate to the containing page's events?
The concrete problem is that I am looking for an event inside the server control that fires before the *Page_Load* event of the containing page.
...
Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler/EventArgs practice, but what I like to do is have something like:
public delegate void EventHandler<T>(object src, EventArgs<T> args);
public class EventArgs<T>: EventArgs {
private T i...
In certain cases, I can't seem to get components to receive events.
[edit]
To clarify, the example code is just for demonstration sake, what I was really asking was if there was a central location that a listener could be added, to which one can reliably dispatch events to and from arbitrary objects.
I ended up using parentApplicatio...
So in my documentation it says:
"C#
public event TreeViewPlusNodeCheckedEventHandler NodeChecked()
You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree."
So how do I add a method to my code behind file that will run when a node is checked? The method I want to run is:
protected...
It's not a matter of life or death but I wonder if this could be possible:
I got a couple of events from one type of custom event (FormEvent) now I got a FormListener that listens to all those events and handles them according to the event type. Instead of adding one eventListener at the time I wish to add all events at once.
so now it...
I have a Flex application where I'm using a Canvas to contain several other components. On that Canvas there is a Button which is used to invoke a particular flow through the system. Clicking anywhere else on the Canvas should cause cause a details pane to appear showing more information about the record represented by this control.
T...
After a bind a method to an event of a Tkinter element is there a way to get the method back?
>>> root = Tkinter.Tk()
>>> frame = Tkinter.Frame(root, width=100, height=100)
>>> frame.bind('<Button-1>', lambda e: pprint('Click')) # function needed
>>> frame.pack()
>>> bound_event_method = frame.???
...
In C#, I find myself occasionally wanting to register a method for an event in the middle of a dispatch of that same event. For example, if I have a class that transitions states based on successive dispatches of the same event, I might want the first state's handler to unregister itself and register the second handler. However, I don'...
I have a Windows Form project that I've just started. On the form I have a listbox that I'm loading with Products. When someone double clicks a Product, I want it to raise a ProductChanged event. Other things in my project will subscribe to this event and update things like other parts of the GUI when the Product changes.
My question i...