Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting.app / trunk / org.gvsig.scripting.app / org.gvsig.scripting.app.extension / src / main / resources / scripting / scripts / examples / dialogs / inputbox.py @ 393

History | View | Annotate | Download (563 Bytes)

1
import commonsdialog
2

    
3
def main():
4
    '''
5
    Asks to display a text using the commonsdialog functions
6
        - msgbox
7
        - inputbox
8
    If not text show Warning message
9
    '''
10
    messageType = commonsdialog.QUESTION
11
    title = 'Inputbox'
12
    text = commonsdialog.inputbox('Write text to show',
13
        title,
14
        messageType
15
    )
16
    if not text:
17
        text = 'You must write text to  show'
18
        title = 'Warning'
19
        messageType = commonsdialog.WARNING    
20
        
21
    commonsdialog.msgbox(text,
22
        title,
23
        messageType
24
    )