<s> """<STR_LIT>""" <EOL> from pyjamas . ui . SimplePanel import SimplePanel <EOL> from pyjamas . ui . VerticalPanel import VerticalPanel <EOL> from pyjamas . ui . HTML import HTML <EOL> from pyjamas . ui . Button import Button <EOL> from pyjamas . ui . PopupPanel import PopupPanel <EOL> class PopupPanelDemo ( SimplePanel ) : <EOL> def __init__ ( self ) : <EOL> SimplePanel . __init__ ( self ) <EOL> vPanel = VerticalPanel ( Spacing = <NUM_LIT:4> ) <EOL> self . _btn = Button ( "<STR_LIT>" , getattr ( self , "<STR_LIT>" ) ) <EOL> vPanel . add ( HTML ( "<STR_LIT>" ) ) <EOL> vPanel . add ( self . _btn ) <EOL> self . add ( vPanel ) <EOL> def showPopup ( self , event ) : <EOL> contents = HTML ( "<STR_LIT>" ) <EOL> contents . addClickListener ( getattr ( self , "<STR_LIT>" ) ) <EOL> self . _popup = PopupPanel ( autoHide = True ) <EOL> self . _popup . add ( contents ) <EOL> self . _popup . setStyleName ( "<STR_LIT>" ) <EOL> left = self . _btn . getAbsoluteLeft ( ) + <NUM_LIT:10> <EOL> top = self . _btn . getAbsoluteTop ( ) + <NUM_LIT:10> <EOL> self . _popup . setPopupPosition ( left , top ) <EOL> self . _popup . show ( ) <EOL> def onClick ( self , sender = None ) : <EOL> self . _popup . hide ( ) </s>
