Forum Archive

Tableview and attributes set with UI Editor issue

Dann239

If I set font sizes in UI Editor for Tableview:
https://dl.dropboxusercontent.com/u/2769367/image.jpg

It doesn't end up applying:
https://dl.dropboxusercontent.com/u/2769367/image1.jpg

Same if I set it manually with the ListDataSource.font

Ideas?

omz

Hmm, I can't reproduce this here. Could you show your code? Perhaps you're re-assigning the data source somewhere?

Dann239

https://gist.github.com/PyDann/2f5685e47f28f867d1c6

I remember somewhere... Docs or forum post about not putting references to UI elements in the UI class init, which is where my font setting is. Even at that, I still changed the font size in the UI editor and nothing changed.

omz

Well, you're creating a new data source in your __init__ method, so anything that you configured in the UI file won't have an effect, as you're replacing it entirely.

Dann239

However, I manually set ui.ListDataSource.font = ('', 10)

omz

You should set self.listsource.font (ui.ListDataSource is the class, not your object).

JonB

You want self.listsource.font, not ui.ListDataSource.font!

Dann239

Completely misunderstood I was creating a new class. I think I get it now. Spent the last 30min reading over documentation and tinkering to get it.