Help with Custom Widget

I am trying to create a custom Widget that willshow a Script and allow you to open it… like what is on the default portal page.

I just havent found how to trigger to open the script from Clicking on the button.

Can anyone help?