Just from guessing at what you mean by i have need to implement the ability to hit enter. you can do the same thing the button does with an Enter by this:
# be sure to use Return and not Enter, Enter is for the mouse events
$mw->bind( '<Return>', sub { $mw->destroy } );