I'm a new in Python.
I would like to know can I create good interface on python, something like WPF?
I didn't find any glass effect with PyQt. It's really important for my decision.
Thanks.
I'm sorry that I didn't give a lot of details. I need to port WPF app to python. The main goal I still need a good UI. Can I make something like this
http://www.codeproject.com/KB/silverlight/SilverlightGlassOrbButton.aspx?msg=3170079
on python? Can I use different styles for mouseover and normal state?
Glass effect is probably a Qt skin and has nothing to do with Python in particular. People say that there's a tutorial for Qt skinning. I failed to quickly google a ready-made glass-like skin, though.
Also, in the new QT RC there is a new support system for GUI related stuff. QML it is called, and examples can be found here. I do not know if it alreade wrapped in PyQT but I suppose it is possible to use it in combination with PyQT.
If glass effect = transparency, then Qt supports this, but it requires a special flag set on the window. See http://doc.qt.nokia.com/qq/qq16-background.html for some examples.
If you want a blurred background, then I doubt it can be done as easily, since not many GUI-frameworks that Qt supports do compositing like Vista & Win7, so it's probably hard to abstract into a cross-platform toolkit.
But simpler things might be possible, and with QGraphicsScene, you can do a lot of these things yourself (but not w.r.t. the window's background, IIUC).
If you have no luck with Qt, wxPython can do it. See How to draw a transparent frame in wxpython.
You can check out the fluent app library
Related
I am in the research/education phase now, and am not seeing a lot of info on the web about applying a Qml-based style to QWidgets. This implies it's difficult or not possible. I doubt it's impossible, but I am curious what the options are for doing that?
Ideally, what I want to do is use the system (user-chosen) theme in my application. I'm on Linux, and it uses GTK and GNOME for themes. I want to support Linux in general (maybe one day, other platforms), so would like to make the app theme cross-distro.
I don't know if this is a tall order. But, is it extremely involved to make PyQt6 QWidgets styled from a QML style? Can widgets use the system theme?
I've been asked to build a gui for a friend. We're going for a fully custom look. All buttons, states, widgets, etc.. will be will be drawn by an artist. The only native widget I foresee needing is a listbox (because I'm not entirely sure how I would build one from scratch).
Additional requirements are mp3 playback support.
The list of available frameworks on python.org is pretty daunting! Could anyone suggest a good starting point?
I apologize for the open ended-ness of the question!
Build it with pygame would be my advice.
That will give you a pixel identical GUI on all platforms - ideal if you have an artist make everything for you.
You'll have to implement your own listbox, but pygame plays mp3s just fine.
I have a project where I have to show some sort of changing bar graph with results from a function. This bar graph should be in colour and 3d. I want it to look good since it's an open source educational program where it teaches the user about different voting systems and how they effect the outcome of an election. I would like to use python but I have no idea about using GUI frameworks since all my work in python has been command line based. Your help will be appreciated.
For 3D graphics, you might want to use OpenGL with a game framework, such as PyGame or Pyglet. Use matplotlib as TJD suggested in the other answer.
As for GUI frameworks, they generally won't help much with 3D graphics:
PyQt is one choice; I see you already have it in the question tags. PySide is very similar to PyQt, but with a nicer licence.
Then there's tkinter (in the standard library), wxPython, and pyGTK – I hear all of them are good, though I don't know them personally.
Pick one and stay with it. It'll take some time to learn if you're not experienced, so don't expect results too soon.
You might want to look at matplotlib, which is probably the most widely used library for doing graphs, including 3-D.
I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?
You just need a gui toolkit (gtk, qt, wx) a image library (PIL) and 500 hours of free time ...
Have you looked at the Python Imaging Library (PIL)?
So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k.
PIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI.
That's where the widgets toolkits come in: You would have to pick a toolkit platform that can offer you buttons, images, load and save the image files, maybe some specialzed widgets you can use to create your color swatches, etc.
both GTK+ and QT4.5 have a liberal license, are very complete and very unpythonic on their use :-(
(While you are at it, when using these libraries and toolkits our app can easily be multiplatform: you don't have to make it windows specific, it is equally easy to create an app that will run on Windows, Linux and Mac using python and either GTK+ or Qt4)
One thing I would suggest is for you to learn to proper use GIMP: it is an Image editor, and certainly it will lack a lot of tools you are needing for sprites: but you can expand it's capabilities with Python plug-ins. On the other hand GIMP does have thousands of features that you'd no longer will need to create for your stand-alone app. (think on layer support, color filters, image rotation etc...)
Check around on how to install GIMP with Python support on Windows, then spend some hours learning the app, with some book-like text around preferably so you can find the hidden features.
Ah, ok, finally:
If you want a very simple thing, just for the taste of "i did it" - you can use Pygame: You have to do all the drawing on the window, including text - but have straighter access to pixels, colors, mouse clicks and coordinates than with GTK+ or Qt, in a sense it would be a lot less of overhead for you to learn in terms of API's and internal working.
You could try PyGame but, seriously, you couldn't find a freeware graphics editor for Windows??!!
EDIT: In the past I've used Aha-Soft's IconXP for pixel work, but it costs USD 30 and doesn't offer all of the Pixen features that I guess you'll want.
I am making a Python gui project that needs to duplicate the look of a Windows gui environment (ie Explorer). I have my own custom icons to draw but they should be selectable by the same methods as usual; click, ctrl-click, drag box etc. Are any of the gui toolkits going to help with this or will I have to implement it all myself. If there aren't any tools to help with this advice would be greatly appreciated.
edit I am not trying to recreate explorer, that would be madness. I simply want to be able to take icons and lay them out in a scrollable window. Any number of them may be selected at once. It would be great if there was something that could select/deselect them in the same (appearing at least) way that Windows does. Then all I would need is a list of all the selected icons.
Python has extensions for accessing the Win32 API, but good luck trying to re-write explorer in that by yourself. Your best bet is to use a toolkit like Qt, but you'll still have to write the vast majority of the application from scratch.
Is there any way you can re-use explorer itself in your project?
Updated for edited question:
GTK+ has an icon grid widget that you could use. See a reference for PyGTK+: gtk.IconView
In wxPython there's a plethora of ready-made list and tree controls (CustomTreeCtrl, TreeListCtrl, and others), a mixture of which you can use to create a simple explorer in minutes. The wxPython demo even has a few relevant examples (see the demo of MVCTree).
I'll assume you're serious and suggest that you check out the many wonderful GUI libraries available for Python.