callback

Why does the ButtonDownFcn callback of my axes object stop working after plotting something?

此生再无相见时 提交于 2019-12-31 02:06:22
问题 I'm creating a set of axes in a figure and assigning a callback for its 'ButtonDownFcn' property like so: HRaxes = axes('Parent', Figure, 'Position', [.05 .60 .9 .35],... 'XLimMode', 'manual', 'ButtonDownFcn', @HR_ButtonDown); Where the callback function is defined as such: function HR_ButtonDown(hObject, eventData) %# Do some stuff here when the axes is clicked on... end The callback works fine until I plot something on the axes like so: plot(HRaxes, data.HR_X, data.HR_Y, 'b'); After which

Why does the ButtonDownFcn callback of my axes object stop working after plotting something?

与世无争的帅哥 提交于 2019-12-31 02:06:16
问题 I'm creating a set of axes in a figure and assigning a callback for its 'ButtonDownFcn' property like so: HRaxes = axes('Parent', Figure, 'Position', [.05 .60 .9 .35],... 'XLimMode', 'manual', 'ButtonDownFcn', @HR_ButtonDown); Where the callback function is defined as such: function HR_ButtonDown(hObject, eventData) %# Do some stuff here when the axes is clicked on... end The callback works fine until I plot something on the axes like so: plot(HRaxes, data.HR_X, data.HR_Y, 'b'); After which

Fresco image loading callback

有些话、适合烂在心里 提交于 2019-12-31 01:57:21
问题 I have just migrated to the Fresco library for loading images in my app. I need to listen to Image Loading Events, of course I read this article in documentation Listening to download events This is exactly what I need, but.... There few things that I don't like. My goal is to hide View if it fails to download it from the net. I cannot reference SimpleDraweeView from controller, even on callback method. I need to hide View , but it seems that I cannot get reference to it. Each time I need to

Passing pointer-to-member-function as pointer-to-function

空扰寡人 提交于 2019-12-30 19:00:09
问题 So here's the situation: I'm using C++, SDL and GLConsole in conjunction. I have a class, SDLGame , which has the Init() , Loop() , Render() etc - essentially, it holds the logic for my game class. GLConsole is a nice library so far - it lets me define CVars and such, even inside my SDL class. However, when defining commands, I have to specify a ConsoleFunc , which is typedef'd as typedef bool (*ConsoleFunc)( std::vector<std::string> *args); Simple enough. However, like I said, my functions

re-initialize jquery accordion on callback

梦想与她 提交于 2019-12-30 18:50:30
问题 I've got the accordion working fine on pageload, however upon user interaction with some elements on the page, I am using ajax to rebuild the HTML of the accordion. Then, I try to re-initialize the accordion again with $('#accordion').accordion({ active: false, autoHeight: false, clearStyle: true, collapsible: true, header: 'h3' }); but... it doesn't seem to be taking. The new block of rendered HTML isn't applying the accordion rules. Instead it just stays open as a large list. I've even

Intermittent crash in recordingCallback() on app launch

丶灬走出姿态 提交于 2019-12-30 16:20:14
问题 My iOS app (using openFrameworks) crashes 30-40% of the time on launch on this line: if(soundInputPtr!=NULL) soundInputPtr->audioIn(tempBuffer, ioData->mBuffers[i].mDataByteSize/2, 1); which is inside the larger function in ofxiPhoneSoundStream.m static OSStatus recordingCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { I am doing audio setup with ofSoundStreamSetup(0, 1,

如何动态加载js?

牧云@^-^@ 提交于 2019-12-30 14:23:24
第三方的js文件,自己写的js文件,js越来越多了怎么办? 提出问题: 1、js文件太多了,每个页面都写<script src="...">太麻烦。 2、如果路径变化了,或者js名称变化了怎么办?每个页面都改一遍吗? 3、如何约束js文件的加载顺序?a.js定义了一个函数,b.js要调用,但是b.js先加载了,a.js还没加载完成,造成函数未定义,无法调用。 4、js文件的合并。开发阶段,js会分成多个文件,这样便于开发。但是成熟了之后会合并成一个文件。这样引用方式就会变化,原先引用一堆js,现在只需要引用一个js。同样不能每个页面都改一遍。 5、加载js完毕之后,要可以执行回调函数。 解决问题: 如何解决这些问题呢?我想到的办法是——动态加载js。就是通过js代码的方式来加载。 在网上找了一些资料,最后确定借鉴 张经纬 的代码 http://www.zhangjingwei.com/archives/asynchronous-loading-js/ 其中这段代码挺符合我的需求。 var loadscript = { $$:function(id){return document.getElementById(id)}, tag:function(element){return document.getElementsByTagName(element)}, ce:function

Jquery google map plugin, adding event listeners

江枫思渺然 提交于 2019-12-30 11:02:14
问题 Can some one explain the meaning of the following code snippet ( jQuery.fn[name] ) found in the google jquery.ui.map plugin: jQuery.each(('click mousedown rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) { jQuery.fn[name] = function(a, b) { return this.addEventListener(name, a, b); }; }); And also how we could bind a callback function to the click event on a map object, I have tried the following but the event does not have the latLng attribute: $('#map

Application.onLowMemory() not invloked

被刻印的时光 ゝ 提交于 2019-12-30 07:54:10
问题 I've create an Application class of my own. I try to debug it and the code stops at Application.onCreate() but does not stop at onLowMemory. To test the scenario I open a lot of other high memory applications. What I see is that the debug session terminated (in eclipse) and some of my static variables turned to null - indicates the the process has ended. Not only did the debug NOT stop @ the breakpoint of the method, I've put a Log.e(...) line and don't see it as well. Any idea of why the

jQuery: Dynamic image handling (waiting for load)

倖福魔咒の 提交于 2019-12-30 07:19:08
问题 I'm trying to write a plugin that has a built in function to wait until all images that are on the page to be loaded before it executes itself. $(window).load() only works if it's the initial load of the page, but if someone wants to pull down some HTML through AJAX that contains images, it doesn't work. Is there any good way of doing this AND implementing it so that it can be self-contained in the plug-in? I've tried looping over $('img').complete , and I know that doesn't work (the images