aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_impl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-07-07 10:33:56 +0200
committerDan Gudmundsson <[email protected]>2011-07-07 10:33:56 +0200
commit98a0a3a7c3d24144c773629dd827bb06ea6cf5c1 (patch)
tree24c5ab39d95362b1b58a5b333ece3174598c96f7 /lib/wx/c_src/wxe_impl.cpp
parent7c9696df18f70cc0431fbb6ea67a25277fe2b2d2 (diff)
downloadotp-98a0a3a7c3d24144c773629dd827bb06ea6cf5c1.tar.gz
otp-98a0a3a7c3d24144c773629dd827bb06ea6cf5c1.tar.bz2
otp-98a0a3a7c3d24144c773629dd827bb06ea6cf5c1.zip
Add support for virtual listctrls
Diffstat (limited to 'lib/wx/c_src/wxe_impl.cpp')
-rw-r--r--lib/wx/c_src/wxe_impl.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 365fb691a1..897c2b7cca 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -395,6 +395,7 @@ int WxeApp::dispatch(wxList * batch, int blevel, int list_type)
// erl_drv_mutex_unlock(wxe_batch_locker_m); should be called after
// whatever cleaning is necessary
memcpy(cb_buff, event->buffer, event->len);
+ cb_len = event->len;
return blevel;
default:
erl_drv_mutex_unlock(wxe_batch_locker_m);
@@ -448,6 +449,7 @@ void WxeApp::dispatch_cb(wxList * batch, wxList * temp, ErlDrvTermData process)
break;
case WXE_CB_RETURN:
memcpy(cb_buff, event->buffer, event->len);
+ cb_len = event->len;
callback_returned = 1;
return;
case WXE_CB_START:
@@ -893,8 +895,6 @@ int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr)
{
callbackInfo * cb = (callbackInfo *)callbackInfoPtr;
wxeMemEnv * memenv = ((WxeApp *) wxTheApp)->getMemEnv(cb->port);
- char * bp = ((WxeApp *) wxTheApp)->cb_buff;
-
wxeReturn rt = wxeReturn(WXE_DRV_PORT, memenv->owner, false);
rt.addInt(cb->callbackID);
rt.addInt(item1);
@@ -904,5 +904,10 @@ int wxCALLBACK wxEListCtrlCompare(long item1, long item2, long callbackInfoPtr)
rt.addTupleCount(3);
rt.send();
handle_callback_batch(cb->port);
- return *(int*) bp;
+
+ if(((WxeApp *) wxTheApp)->cb_len > 0) {
+ char * bp = ((WxeApp *) wxTheApp)->cb_buff;
+ return *(int*) bp;
+ } else
+ return 0;
}