On Sat, Sep 20, 2008 at 6:50 AM, zpcspm <[EMAIL PROTECTED]> wrote:

> The first argument, event,

You can ignore this argument

> The handler argument has the meaning of a callback to me.

It is.  Your method is a callback to k.getArg.  Note that you don't
get a return value from k.getArg directly.  You get the argument via
k.getArg after g.getArg handles all the relevant keystrokes.

> So the current state of my script code is:

> k = c.k
> state_name = 'raw-input'
> state = k.getState(state_name)
> if state == 0:
>    k.setLabelBlue('> ', protect = True)
>    k.getArg(None, 'raw-input', 1)
> else:
>    k.clearState()
>    g.es_print(k.arg)

Please follow the example carefully.  Here is a tested script:

@@@
def getInput (event=None):

    stateName = 'get-input'
    k = c.k ; state = k.getState(stateName)

    if state == 0:
        k.setLabelBlue('Input: ',protect=True)
        k.getArg(event,stateName,1,getInput)
    else:
        k.clearState()
        g.es_print('input:',k.arg)

getInput()
QQQ

The trick is that you must define a function that can be used as a callback.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to