Hey
i fix it in this way: (not professional manner in writing code, but it
works for you now)
name = mc.textFieldGrp()
self.wg['textFieldGrp'] = name.split('|')[-1]

new code:
import maya.cmds as mc

class SimpleUI(object):
    def __init__(self, *args):
        self.wg={}
        self.wg['win'] = 'MySimpleWindow'
        self.wg['dock'] = 'MySimpleDock'

        if mc.dockControl(self.wg['dock'], exists=True):
            mc.deleteUI(self.wg['dock'])
        # window
        mc.window(self.wg['win'])
        # layout
        mc.rowColumnLayout(nc=1)
        """ controls """
        mc.button(l='textField_button',
                  c=self.com_button_command)
        # this works
        name = mc.textField()
        self.wg['textField'] = name.split('|')[-1]
        mc.button(l='textFieldGrp_button',
                  c=self.com_grp_button_command)
        # this does not work
        name = mc.textFieldGrp()
        self.wg['textFieldGrp'] = name.split('|')[-1]
        mc.dockControl(self.wg['dock'],
                       area='left',
                       content=self.wg['win'])

    def com_button_command(self, *args):
        # this works
        mc.textField(self.wg['textField'], e=True, tx='blabla')

    def com_grp_button_command(self, *args):
        # this does not work
        mc.textFieldGrp(self.wg['textFieldGrp'], e=True, tx='blabla')

SimpleUI()

good luck

On Fri, Sep 12, 2014 at 6:34 PM, <[email protected]> wrote:

> Hi
>
> (sorry for my english)
>
> I'm having a hard time about this. So my problem is, when i just create a
> window and put some controls (textField, textFieldGrp) in it. Editing or
> querying with class methods is not a problem. but when i use dockControl to
> build my ui, maya cannot find "_grp" controls
>
> here i post some code:
> textField querying is working, but textField querying is not (error
> message below)
> maya can't find the control. even i print its name and its same as the
> name in the error message.
>
> is it a known bug ?
>
> (by the way, if i change textFieldGrp command to textField, it works)
> (and if i change this to a window (not dock) it works either)
>
>
>
> import maya.cmds as mc
>
> class SimpleUI(object):
>     def __init__(self, *args):
>         self.wg={}
>         self.wg['win'] = 'MySimpleWindow'
>         self.wg['dock'] = 'MySimpleDock'
>
>         if mc.dockControl(self.wg['dock'], exists=True):
>             mc.deleteUI(self.wg['dock'])
>         # window
>         mc.window(self.wg['win'])
>         # layout
>         mc.rowColumnLayout(nc=1)
>         """ controls """
>         mc.button(l='textField_button',
>                   c=self.com_button_command)
>         # this works
>         self.wg['textField'] = mc.textField()
>         mc.button(l='textFieldGrp_button',
>                   c=self.com_grp_button_command)
>         # this does not work
>         self.wg['textFieldGrp'] = mc.textFieldGrp()
>         mc.dockControl(self.wg['dock'],
>                        area='left',
>                        content=self.wg['win'])
>
>     def com_button_command(self, *args):
>         # this works
>         mc.textField(self.wg['textField'], e=True, tx='blabla')
>
>     def com_grp_button_command(self, *args):
>         # this does not work
>         mc.textFieldGrp(self.wg['textFieldGrp'], e=True, tx='blabla')
>
> SimpleUI()
>
>
> """Error Code"""
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/195e1b55-5bcb-4248-8a63-7b13d6d90bf2%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Bests,
madoodia

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CADvbQw%2BzAPuEZk8L-BEWUCHvievsh4PtwCo3hW4zMH_7AWJCHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to