Logo Search packages:      
Sourcecode: ldtp-doc version File versions  Download package

removecallback

Syntax

removecallback ('<window title>')

Description

Remove the callback function that was registered with onwindowcreate

Implementation

Todo:
Return values:
1 on success, else LdtpExecutionError exception
Refer: http://webcvs.freedesktop.org/ldtp/ldtp/src/client-handler.c, http://webcvs.freedesktop.org/ldtp/ldtp/src/ldtp-gui.c

Example

With respect to gedit application, replace dialog

 from ldtp import *

 import threading

 callbackRunning = threading.Event ()

 callbackRunning.clear ()

 callbackState = threading.Event ()

 callbackState.clear ()

 def cb ():

	callbackState.set ()

	waittillguiexist ('dlgReplace')

	click ('dlgReplace', 'btnClose')

	callbackState.clear ()

	callbackRunning.set ()

	print 'callbackend'

 onwindowcreate ('Replace', cb)

 click ('*gedit', 'btnReplace')

 click ('*gedit', 'btnFind')

 waittillguiexist ('dlgFind')

 click ('dlgFind', 'btnClose')

 if callbackState.isSet ():

	print 'Waiting for callback to complete'

	callbackRunning.wait ()

	print 'callbackset'

 print 'test end'

 removecallback ('Replace')

 

Author:
Nagappan A <nagappan@gmail.com>

Generated by  Doxygen 1.6.0   Back to index