Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pure python gui library?

Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries.

Recently, I have thought about python's built-in ctypes module. Theoretically, it's possible to create a pure python GUI library that will use ctypes on windows ( windll.user32.CreateWindowEx, etc ), native pyObjC on MacOS and pyGTK / pyQt on gnome / kde. Does such a library exist? If not, what do you think is wrong with this idea?

like image 618
grigoryvp Avatar asked Jun 24 '09 10:06

grigoryvp


4 Answers

starting in Python 2.7 and 3.1, Tk will look a lot better.

http://docs.python.org/dev/whatsnew/2.7.html#ttk-themed-widgets-for-tk

"Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk widgets but have a more customizable appearance and can therefore more closely resemble the native platform’s widgets. This widget set was originally called Tile, but was renamed to Ttk (for “themed Tk”) on being added to Tcl/Tck release 8.5."

like image 105
Corey Goldberg Avatar answered Sep 28 '22 09:09

Corey Goldberg


The path of least effort and best results would be to learn what it takes to deploy an app using those existing GUI libraries.

like image 26
Craig McQueen Avatar answered Sep 28 '22 11:09

Craig McQueen


Tkinter is part of the python standard distribution and is installed by default. Expect to find this on all python installs where there is a graphical display in the first place.

like image 30
SingleNegationElimination Avatar answered Sep 28 '22 11:09

SingleNegationElimination


Notion of "pure python gui library" is wrong because ultimately you will be using system level calls and widgets, may be thru ctypes but that doesn't change the fact that if you start implementing your idea you will eventually become wxPython

like image 34
Anurag Uniyal Avatar answered Sep 28 '22 10:09

Anurag Uniyal