Changeset 236

Show
Ignore:
Timestamp:
06/07/08 16:23:23 (7 months ago)
Author:
tal
Message:
Added placeholder text.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/vanilla/trunk/Lib/vanilla/vanillaSearchBox.py

    r206 r236  
    2727    nsSearchFieldClass = NSSearchField 
    2828 
    29     def __init__(self, posSize, text="", callback=None, formatter=None, sizeStyle="regular"): 
     29    def __init__(self, posSize, text="", callback=None, formatter=None, placeholder=None, sizeStyle="regular"): 
    3030        """ 
    3131        *posSize* Tuple of form (left, top, width, height) representing the position and size of the search box. 
     
    4242        *formatter* An "NSFormatter": http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFormatter_Class/index.html for controlling the display and input of the text entry. 
    4343 
     44        *placeholder* A placeholder string to be shown when the text entry control is empty. 
     45 
    4446        *sizeStyle* A string representing the desired size style of the search box. The options are: 
    4547 
     
    5557        if formatter is not None: 
    5658            cell.setFormatter_(formatter) 
     59        if placeholder: 
     60            cell.setPlaceholderString_(placeholder) 
    5761 
    5862    def getNSSearchField(self):