Hi,

Thanks for the comment, Justin. I forgot the key rule of always simplifying 
first  to make sure it works, and then add the bells and whistles. It works 
now. You have to specify the number of tabs in the  constructor and then 
name each tab in the self.name variable.

http://pastebin.com/pWgfWtvT

The next step is to set it up so each tab has both the common buttons 
("Create" & "Cancel") as well as its own unique custom buttons.

Is there an efficient way of making the custom buttons method different for 
each tab dynamically, based on a preset of established properties, or will 
they have to be "hardcoded" in the class instance?

I find using the class methodology very useful, but sometimes I wonder if 
I'm trying to over-complicate things by trying to create a catch-all 
framework for all possible scenarios...

Comments and suggestions always welcome.

p.s. the common buttons are not properly laid out yet. Setting up the the 
formLayout to arrange that now.


On Thursday, February 13, 2014 12:18:14 PM UTC-5, flaye wrote:
>
> Hi,
>
> I'm trying to build a UI class that will generate dynamic tabs based on a 
> variable in the __init__ method.
> The idea is this:
>
>    1. set the initial variable number in __init__ (can be changed later 
>    on the instanced class)
>    2. in the createUI() method, query the variable, and set it to 
>    dynamically create a tab in the formLayout
>    3. Each tab will have common properties (distance from UI window, 
>    common buttons (which are in a commonButtons() method), as well as the 
>    possibility of customButtons())
>    4. ...and that's it - for now.
>
> I understand also that for this to work, the tabs themselves should be 
> dictionaries, in order to get the dynamic creation happening.
>
> I get the logic, but unfortunately the Python syntax still eludes me 
> somewhat.
>
> Here's the link to the code:
>
> http://pastebin.com/KHFJF1jX
>
> Much appreciated!
>

-- 
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/e1e5838d-f7c9-494a-82b6-dbf0013c1a73%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to