<s> from atom . api import Typed <EOL> from enaml . widgets . push_button import ProxyPushButton <EOL> from . QtGui import QPushButton <EOL> from . qt_abstract_button import QtAbstractButton <EOL> from . qt_menu import QtMenu <EOL> class QtPushButton ( QtAbstractButton , ProxyPushButton ) : <EOL> """<STR_LIT>""" <EOL> widget = Typed ( QPushButton ) <EOL> def create_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> self . widget = QPushButton ( self . parent_widget ( ) ) <EOL> def init_layout ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( QtPushButton , self ) . init_layout ( ) <EOL> self . widget . setMenu ( self . menu ( ) ) <EOL> def menu ( self ) : <EOL> """<STR_LIT>""" <EOL> m = self . declaration . menu ( ) <EOL> if m is not None : <EOL> return m . proxy . widget <EOL> def child_added ( self , child ) : <EOL> """<STR_LIT>""" <EOL> super ( QtPushButton , self ) . child_added ( child ) <EOL> if isinstance ( child , QtMenu ) : <EOL> self . widget . setMenu ( self . menu ( ) ) <EOL> def child_removed ( self , child ) : <EOL> """<STR_LIT>""" <EOL> super ( QtPushButton , self ) . child_removed ( child ) <EOL> if isinstance ( child , QtMenu ) : <EOL> self . widget . setMenu ( self . menu ( ) ) </s>
