ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

Use ttk styles; upgrade model editor #353

Open sf-issues opened 11 years ago

sf-issues commented 11 years ago

Converted from SourceForge issue 1987998, submitted by ceball Submit Date: 2008-06-08 08:04 GMT

Rather than local specification of e.g. bg='blue', should switch to using ttk styles.

I.e.

l = Tkinter.Label(text="Test", fg="black", bg="white")

would be more like

(setup style 'x' somewhere, then...)

l = Tkinter.Label(text="Test", style="x")

(see e.g. http://gpolo.ath.cx:81/pydoc/library/ttk.html)

Note that the only thing holding us back from using ttk widgets right now is the model editor, which contains incompatible formatting specifications.

Also note that ttk is heading for integration in the official python distribution of tkinter (see http://gpolo.ath.cx:81/projects/ttk_to_tkinter/). When the GSOC project is finished, we should switch to it from the Tile.py wrapper we're currently using.

sf-issues commented 11 years ago

Submitted by jbednar Date: 2008-06-10 21:46 GMT

Can you estimate how hard it would be to switch the Model Editor? Is that a big project?

sf-issues commented 11 years ago

Submitted by ceball Date: 2008-06-10 22:12 GMT

I think it's a small project (i.e. hours, not days). The problem, though, is that Tkinter.py in Python 2.5 (and possibly 2.6, I'm not sure) has some incompatibilities with tcl/tk 8.5, and I think these are exposed by the model editor. I suspect that, after converting the model editor code, there'd be some problems caused by Tkinter.py (and I don't know how serious they'd be).

I should really find that out for sure while the GSOC project is ongoing, so that I could possibly get the GSOC project to sort out some of the problems. (The GSOC project is progressing really fast, so I might even consider trying to use it already. Also, the GSOC project is converting IDLE to work with Tk 8.5 - currently there are some problems if you try using IDLE with Tk 8.5.)

sf-issues commented 11 years ago

Submitted by ceball Date: 2009-07-16 17:24 GMT

The Tkinter.py incompatibilities with tcl/tk 8.5 that I mentioned before have been corrected: http://bugs.python.org/issue2906

Python 2.5 later than 2.5.3 includes the fixes.

Therefore, to use ttk, all we would have to do (after updating python) is install the ttk package (one is available for 2.5; Python 2.7 includes ttk) and update the model editor.

I'm incorporating #1829833 (turn model editor into a plotgroup and clean it up) with this bug, because they should be sorted out together (before release 1.0).

jlstevens commented 9 years ago

See ioam/paramtk#2 . Is making the Tk GUI prettier still something we consider necessary for Topographica 1.0?

jbednar commented 9 years ago

No, not necessary for 1.0. But once I get around to dealing with the tkgui #523 pull request already in place for the model editor, it would be good to make this change, because it would simplify and make it more uniform and maintainable. I don't see us having a non-Tk version of the Model Editor any time soon, and thus no way to make architecture diagrams easily...

jlstevens commented 9 years ago

In the new system, model diagrams should be generated from ModelSpecs. Some code would take in a ModelSpec and output an architecture diagram.

Not that anyone is going to do this right now...

jbednar commented 9 years ago

Exactly.