callback

Call Back Functions

Someone suggested to me to use Call Back Functions to implement a timer to run in the background while my Server application reads input from clients. I tried looking at explanations online, but was hoping if someone could give me a simpler analogy. Thanks. ...

Custom delegate : How to call back from modalViewController tapping on done ?

Hi all , I want to use custom delegate in my search tab. I have never used my own custom delegate in any application ( this is the just second one ). The scenario is as below : In the search utility ,If I am pressing select category , a modal view controller will be presented in that I am passing a category controller as a parameter...

How to tell difference between python class and object?

Possible Duplicate: How to identiy whether a variable is a class or an object I have a function which accepts 'things' which it calls. def run_it(thingy): result = thingy(something) However, I'd like run_it() to accept both classes and objects/functions, and if it is a class, instantiate it first: def run_it(thingy): ...

Managing lots of callback recursion in Nodejs

In Nodejs, there are virtually no blocking I/O operations. This means that almost all nodejs IO code involves many callbacks. This applies to reading and writing to/from databases, files, processes, etc. A typical example of this is the following: var useFile = function(filename,callback){ posix.stat(filename).addCallback(function (...

beforeSend in $.getJSON

How do I use beforeSend callback in $.getJSON(cross domain). More specifically $.getJSON is call is to a YQL service Like select * from html where url=”http://www.yahoo.com” ...

How do I execute a callback function from another function file in MATLAB?

I have two functions: one which creates the UI with buttons, and another one from which I'd like to execute the same function as pressing the button does. When I dig into the figure with get(gcf,'children') I find the buttons, with a Callback property that looks like this: ans = [function_handle] [ 1] [ ...

Plain C callback function pointer as part of iPhone delegate protocol?

Trying to integrate plain C/C++ code into iPhone project as an external static library. So far so good, but now I'm stuck at a point, where I need to register library callbacks. The library should notify my iPhone application, when something happens. Seems like a good place to define a Delegate. ...but the library is expecting C functio...

How to call a function/procedure asynchronously in Delphi (Without components)

I am trying to run a function or procedure in Delphi asynchronously, but without using a component, is there a way to do it with delphi core functions? ...

How to implement automatic properties in VS 2005 for a delegate callback

I'm attempting to get the TwainDotNet solution I found here (http://stackoverflow.com/questions/476084/c-twain-interaction) to compile, and I'm at my wits end. This solution was obviously developed in VS 2008, and I'm working in 2005 (no choice at the moment). I've spent probably WAY to much time getting this all to compile in 2005, an...

msgStore was not declared in this scope (XCode)

I'm implementing callback routines for external static C++ library to be used in Objective-C project. Now I have trouble moving data between callback and normal routines. As you can see below my "msgStore" is defined as part of MyMessage class and can be used within class routines such as init(). However attempting same from callback rou...

How to implement a callback method within DLL (Delphi / TJVPluginManager + TJvPlugin)

Hello, I'm building an application working with plugins. I'm using the excellent JVCL plugin framework. I first started to use package plugin. It worked like a charm but had a big drawback : the needs to give runtimes bpl (23Mo). So I switch to DLL plugin. I need to call a method (procedure having 3 parametes) from hostapplication but ...

jQuery: Handle fallback for failed AJAX Request

Can jQuery provide a fallback for failed AJAX calls? This is my try: function update() { var requestOK = false; $.getJSON(url, function(){ alert('request successful'); requestOK = true; }); if (!requestOK) { alert('request failed'); } } Unfortunately, even if the callback function of the $...

When is a Cocoa callback given controll?

Hi, I've been searching around the web for an answer to this one, but was unable to find an answer, on the other side I think it's something quite common thus there is a possibility I'm missing some keywords here. Anyhow, the problem is as follows: When is control given to a callback function in ObjC (iPhone)? Does it happen after con...

How to force Sequential Javascript Execution?

Ive searched a lot of places for the answer to this seemingly simple problem, but Ive only found rather complicated answers involving classes, event handlers and callbacks (which seem to me to be a somewhat sledgehammer approach). I think callbacks may be useful but I cant seem to apply these in the simplest context. See this example: <...

exist a javascript callback cache??

Look this code guys: <script type="text/javascript"> $("#<?=$delete_uid?>").click(function() { var id = $("#<?=$grid_uid?>").jqGrid('getGridParam','selrow'); alert(id); if(id == null) { $.jGrowl("No selected Item"); return; } confirm('Caution','Delete current selected item?', function(result) { ...

ObjC delegate methods never gets called

Hi all, I am creating instances of a class FlickrImage parsing a Flickr API photos response. The class has a method getLocation that does another API call to get the geolocation: NSLog(@"getting location for %i",self.ID); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; OFFlickrAPIRequest *flickrAPIRequest = [[OFFlickrAPIReq...

How to force screen update for list view from non-UI thread (iPhone)

I have a background thread listening to network, using a callback to process and store data. When it's ready (UI) controller gets a sync Notification, requests data, updates list and refreshes screen ...except screen doesn't update - until user scrolls the screen! void aMessageArrivedCBack (const std::string text) { NSAutoreleasePoo...

AJAX and callback function

Hi, I will try to explain my problem. I have 4 files index.html, event.js, start.js and form.php. index.html <head><script type="javascript/text" src="start.js></script></head> <html> <button id="bt" type="button">Click</button> <div id="test"></div> </html> start.js window.onload=init; function init(){ document.getElementById("bt")...

pass int to a C callback

Why i is not recognized correctly in the callback? I think that maybe because after add_strip() "i" is destroyed, so how could i pass an int to that callback? Thanks. 29 void add_strip(int i,char name[30]){ 30 sl[i] = elm_slider_add(win); 31 elm_slider_label_set(sl[i], name); 32 elm_slider_unit_format_set(sl[i], "dB"); 33 ...

Blocking behavior of PyGTK's main loop

My intention was to use pyGTK's main loop to create a function that blocks while it waits for the user's input. The problem I've encountered is best explained in code: #! /usr/bin/python import gtk def test(): retval = True def cb(widget): retval = False gtk.main_quit() window = gtk.Window(gtk.WINDOW_TOPLE...