Around the Wordpress icons page you can observe that some widgets' width increases whenever you click/toggle them within the sidebar. How do i do this with my very own icons? I am while using Wordpress_Widget class.

Thanks!!

Whenever you register the widget you are able to set the widget control options, which allows to manage the width.

Look into the following sample code:

<?php
class WP_Widget_Text_Link extends WP_Widget {

    function WP_Widget_Text_Link() {
        $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML with Title linked'));
        $control_ops = array('width' => 600, 'height' => 350);
        $this->WP_Widget('textlink', __('Text with Link'), $widget_ops, $control_ops);
    }

    // stripped down remaining code for the widget, which are not needed for the answer.
}