|
From: Kevin A. <al...@se...> - 2002-02-20 08:03:26
|
> From: Andy Todd
>
> My latest design dilemma is how to differentiate between enterable and
> display only information in my application.
>
> When I am fetching data into my application from a database some values
> will be directly enterable by the user but others are 'reference' values
> that shouldn't be changed at that time or in that place.
>
> I'm currently putting the enterable data in TextField widgets and my
> unchangeable data in StaticText widgets. But, to differentiate the
> non-updateable StaticText widgets from my actual boilerplate I would
> like them to be different colours.
You can also make TextField widgets non-editable ('editable':0) or disabled
('enabled':0). Non-editable fields don't look any different, but the user
can only copy the text, not change it.
> I would like to specify my colours as default values (say in a module
> level variable in the .py file) which are then picked up in the resource
> file. But I couldn't find a way to do it.
>
> In the first instance I just want to be able to specify a variable
> *somewhere* and reference it in my resource file, e.g.
>
> { ... 'foregroundColor': MYFGCOLOUR ... }
>
> But I don't think there is any way to do this in the current framework -
> or is there? Am I stuck with strings in my resource file that I have to
> do a search and replace for when my fickle nature dictates a
> colour change?
There is no way of doing that kind of replacement automatically the way
resource loading works right now since it does an eval() to turn the whole
file into a dictionary. If we changed the resource loading so that resources
were loaded via a real import then constants could be defined and they would
propogate through the file correctly. That is one scheme we've discussed in
the past and it appeals to me.
> If there is a way to do this, or we can build one into the framework we
> could then provide a user configurable colour scheme, or expand it to a
> full blown skinning system. Which is probably overkill but I thought I
> would mention it anyway.
In the meantime, just add a method to change the colors and then call that
method from your openBackground handler. The method just needs a list of the
relevant components and then it can iterate through the list setting the
foregroundColor.
ka
> Regards,
> Andy
> --
> -----------------------------------------------------------------------
> From the desk of Andrew J Todd esq.
> "So I curtailed my Walpoling activities, sallied forth and infiltrated
> your place of purveyance to negotiate the vending of some cheesy
> comestibles." - Monty Python.
>
>
> _______________________________________________
> Pythoncard-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythoncard-users
>
|