[jQuery] subclassing widgets

[jQuery] subclassing widgets


hello,
is it possible to subclass widgets? specifically ui.dialog?
ive tried something like the following but cant get it to work.
$.widget("ui.mydialog", $.extend($.ui.dialog, {
init: function() {
$.ui.dialog.prototype.init.apply(this, arguments);
// custom stuff....
}
}));
any hints/examples?
thanks dunk.