[Bf-committers] Declarative UI Experiment
ideasman42 at gmail.com
Tue Aug 10 14:14:01 CEST 2010
The second python markup example was just made up using python like
syntax so I had a go at making the declaration into working python.
To show its an XML equivalent theres a XML conversion function as well
(output at the bottom).
Elia, using a python based definition inline just means we can keep
the same classes and don't have the hassle of creating a whole new set
of files, getting the poll functions inlined in XML (or similar).
On Tue, Aug 10, 2010 at 8:03 PM, Elia Sarti <vekoon at gmail.com> wrote:
> How does this make it more like what we have now?
> You'd still need to rewrite all UI scripts from scratch.
> As I said to avoid having two different ways to do 1 thing you simply
> let Python have full control of the layout system itself (even leaving
> the same exact API as now, just adding some more) so if you're a Python
> developer you can do everything in Python, while if you're a user you
> can use a simpler declarative language (but our own integrated custom
> language, not XML).
> Thomas Dinges wrote, on 08/10/2010 07:47 AM:
>> Hey Campbell,
>> my main -1 argument was because of the big language change.
>> Also i was afraid of then having 2 files for a script (a py file for
>> operators and 1 xml file for the ui)
>> The first 2 versions you propose now are much better than the xml
>> version in my oppinion.
>> I even would prefer the second method, as it is much more readable.
>> As I said, let's focus more on what we have now and make changes to that.
>> +1 to that now. ;-)
>> Am 10.08.2010 05:34, schrieb Campbell Barton:
>>> As I feared the 'XML' topic came up, and without replying to each
>>> statement made above lets just say its a very different direction to
>>> the one we have been going in and I can understand resistance.
>>> The original spec for 2.5 was that we would have a UI layout defined in python,
>>> So here are 2 examples of python defined declarative UI's which could
>>> fairly easily co-exist with what we have now.
>>> - basically a python version of the XML panel
>>> - this is python also but relies on having some custom classes defined
>>> which would expand themselves into the data structure above. Its nice
>>> in that it is much easier to read/write, but its also not pure python.
>>> - original XML for reference.
>>> For those who gave the proposal a -1, what about one of the 2 methods above?
>> Bf-committers mailing list
>> Bf-committers at blender.org
> Bf-committers mailing list
> Bf-committers at blender.org
More information about the Bf-committers