I stumbled across this solution a while back; this might be what you are looking for:
I added this to my theme’s functions.php file…
// First, I created a shortcode for a function, that would typically be inserted in to a template file, so that it could be inserted in to a widget.
add_shortcode('myshortcode', 'myfunction');
function myfunction() {
if ( function_exists( 'get_smooth_slider_category' ) ) { get_smooth_slider_category('featured'); }
}
// Then you can add this to allow shortcodes to be used in widgets.
/* Make shortcodes work in widgets */
add_filter('widget_text', 'do_shortcode');
Then I just added [myshortcode]
to the text widget and viola; I have a function in a widget.