jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

Table Coloring? #517

Closed robertmlinden closed 6 years ago

robertmlinden commented 6 years ago

Is there a way to style Tables? There doesn't seem to be documentation for this beta widget.

EDIT: documentation on styling

robertmlinden commented 6 years ago

Specifically, individual table rows. I mean there's highlighting, but there's no custom coloring so far as I can see. I would like to give the table a dark theme with light text, perhaps!

jarvisteach commented 6 years ago

There is a way to do it, using the new 1.0 syntax.

tbl

You can set any of: activeFg, inactiveFg, activeBg, inactiveBg:

from appJar import gui 

with gui() as app:
    app.table("g1",
        [["Name", "Age", "Gender"],
        ["Fred", 45, "Male"],
        ["Tina", 37, "Female"],
        ["Clive", 28, "Male"],
        ["Betty", 51, "Female"]],
        inactiveBg='red', inactiveFg='yellow',
        activeBg='blue', activeFg='white'
        )   
jarvisteach commented 6 years ago

There are other properties that could be set, they;re just not implemented yet...

robertmlinden commented 6 years ago

Thank you!

robertmlinden commented 6 years ago

Can such properties only be assigned in the table's 1.0 constructor or is there a way to recolour afterwards?

e.g. .setTableActiveFg() (which isn't recognized)

jarvisteach commented 6 years ago

Closing, noted in backlog #266