You can access the function by accessing the copy that was stored when you created this instance of the widget, like this:
"Ok":function(){
$.data(this, "ImageLibrary")._somePrivateFunction.call(this);
}
You can give it a try here.
Another method, if it's an option, is to make it accessible via the widget bridging that happens (if people are overriding the button arguments, it'll need to be accessible anyway), like this:
$.widget("ui.ImageLibrary", $.ui.dialog, {
options: {
title:'Choose Image',
buttons:{
"Ok":function(){
$(this).ImageLibrary("someFunction");
},
"Close":function(){
$(this).ImageLibrary("close");
}
}
},
someFunction: function(){
alert("test");
}
});
You can give it a try here. The difference is obviously it's not strictly private anymore, but if someone else needs to change what that "ok" button does, would you maybe want it exposed anyway? Something to keep in mind overall, so just tossing this out there.