ó
Ń%Tc           @   sp   d  Z  d d l Z d d l Z d Z d Z d Z e j j e j j	 e
   Z d   Z d d  Z d	   Z d S(
   s>   Common constants and functions used in the various GUI modulesi˙˙˙˙Ni   i
   i   c         C   s   t  j   } t  j t d  } t  j | t  j  } t  j |   } | j | t t d  | j | t t d  | j |  | S(   sú  Create a button object with the specified label and GTK stock image.
    
    ARGUMENTS:
        label  - the text label for the button
        image  - the name of the GTK stock image
    RETURNS:
        button - the constructed button object
    NOTE:
        The buttons created here are different than the stock buttons created by gtk.Button().
        Buttons created by gtk.Button() ignore the label if it does not match the stock image and
        resize differently than buttons created here.
    i    i   (	   t   gtkt   Buttont   HBoxt   Falset   image_new_from_stockt   ICON_SIZE_BUTTONt   Labelt
   pack_startt   add(   t   labelt   imaget   buttont   hboxt   buttonImaget   buttonLabel(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/guiUtils.pyt   buttonWithIcon   s    t   RCranec         C   s?   t  j t  j  } | j |   | j t j j t d   | S(   sÍ   Create a new window object with the appropriate name and icon
    
    OPTIONAL ARGUMENTS:
        title - the title for the window.  Defaults to "RCrane"
    RETURNS:
        window - a window object
    s   icon.svg(	   R    t   Windowt   WINDOW_TOPLEVELt	   set_titlet   set_icon_from_filet   ost   patht   joint
   rcranePath(   t   titlet   window(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/guiUtils.pyt   createRCraneWindowObject6   s    	c         C   sP   t  j d t  j d t  j  } | j d  | j |   | j   | j   d S(   s   Create a RCrane error dialog popup
    
    ARGUMENTS:
        errorText - the text of the error message to report to the user
    RETURNS:
        None
    t   typet   buttonss   RCrane ErrorN(   R    t   MessageDialogt   MESSAGE_ERRORt
   BUTTONS_OKR   t
   set_markupt   runt   destroy(   t	   errorTextt   errorDialog(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/guiUtils.pyt   createRCraneErrorDialogE   s
    	
(   t   __doc__t   os.pathR   R    t   VBOX_SPACINGt   HBOX_SPACINGt   BUTTON_SPACINGR   t   dirnamet   abspatht   __file__R   R   R   R&   (    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/guiUtils.pyt   <module>   s   	