A couple of ways of doing something like this.... first one is a really
simiple UI that selects, if it can, as you're typing. The cmds.textFieldGrp
has an additional flag tcc which is updated as you type rather than on
enter.

if cmds.window('a',exists=True):
    cmds.deleteUI('a')
cmds.window('a', title='test', w=300, h=100,mnb=False, mxb=False)
mainLayout = cmds.flowLayout()
cmds.textFieldGrp('textInput',label='test',
text='',tcc="cmds.select(cmds.textFieldGrp('textInput',q=True,text=True))")
cmds.showWindow('a')


Or a much better way of doing it is to wrap this into a callback function
that manages the command and gives you some error checking on the way

from functools import partial
def selectionCallback(*args):
    txt=cmds.textFieldGrp('textInput',q=True,text=True)
    if cmds.objExists(txt):
        cmds.select(txt)
    else:
        print 'Object no Found'

if cmds.window('a',exists=True):
    cmds.deleteUI('a')
cmds.window('a', title='test', w=300, h=100,mnb=False, mxb=False)
mainLayout = cmds.flowLayout()
cmds.textFieldGrp('textInput',label='test',tcc=partial(selectionCallback))
cmds.showWindow('a')

hope that helps

Mark



On 23 April 2013 12:00, Daz <dariusz1...@gmail.com> wrote:

> Heya
>
> Thanks for reply Justin!
>
> I did what you suggested but I still cant set attr.
> I get this error:
>
> # RuntimeError: setAttr: Error reading data element number 1: .25 #
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To post to this group, send email to python_inside_maya@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
-------------------------------------
Mark Jackson
Technical Animation Director
http://markj3d.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to