Python GUI custom buttons - python

I am looking to make a GUI in python but currently do not have much experience. The GUI must have a few key features, namely a slider bar to control audio, and a few basic menu buttons. I realize essentially all GUI development tools could handle these simple features, but I am also interested in some custom content as well. The basic look of the GUI I am looking to create is shown here:
In the image, the slider volume bar, "button1," "button2," the colored circles, and any slice of the circle (one highlighted section is shown) needs to be clickable and interactive. Moreover, the small colored circles must be able to dynamically revolve around the edge of the circle and remain clickable at all times. I have not used any GUI development tools yet, but have looked into pyGTK, pyQT, wxWidgets, and Kivy. Can anyone who has used these tools recommend which would be best suited? As far as shapes of buttons, am I restricted?

You can use pyopengl, pygame , pygtk .
I have one example how to show this images if you want take a look at :
http://free-tutorials.org software free section is decor.tgz example.
In my opinion you can use pyOpenGL is very portable to another language like C,C++ and also you can make it to Linux , Windows , Android.

Related

How to remove borders on Tkinter buttons & frames?

I am currently building a simple app to encrypt files using AES encryption in python but the biggest downside of using Tkinter is the look of the UI. I did some research and found examples of what I want but do not know how to recreate it. (Example)
My problem is that when I replace buttons with images (like the OP of the Reddit post said he did in order to have a decent looking UI) I end up with an ugly bar of grey. (Image of the button)
I also want to remove the same type of bar with frames so if you have the answer for specifically that it would still be appreciated.
Support for for styles and themes has existed in tkinter for some time. A theme being a collection of styles for different widgets.
You can read more about style and themes here.
To the best of my knowledge, the standard widgets to not support rounded corners. All widgets have rectangular shapes.
You might be able to create something like that using a Canvas, but it would be a significant amount of work.
A more relevant point is that it might confuse your users if you don't reproduce the way the standard controls work.
UI elements are standardized for the same reason the controls in a car are; once you know one of them you can use all of them.

How would I be able to place a VPython simulation display into a certain area of a PyQt5 GUI?

I'm building a 2D simple projectile motion simulation. I have the GUI layout on the PyQt5 side set (with buttons/dropdowns/checkboxes, but none work yet), and the VPython physics code set as well. I have a large area of the windowed application meant to show the screen (the same one that would pop up in a browser with only VPython code). I can't figure out how to connect the simulation visual to that portion of the window, so how would I do that? What widget should I use?
It's also worth mentioning that I am at an intermediate level with VPython and Python itself, but a complete beginner with PyQt5, so I've built the whole GUI in the Qt Designer.
I don't know if it's worth posting my code here as all of it is completely unmodified Qt Designer code with no references to VPython, but here's the code for the black box, which was placed in the UiMainWindow() class:
self.simulation_view = QtWidgets.QOpenGLWidget(self.centralwidget)
self.simulation_view.setGeometry(QtCore.QRect(70, 10, 961, 541))
self.simulation_view.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.simulation_view.setObjectName("simulation_view")
Here's a screenshot of the GUI, with the black box being an OpenGL widget (which is probably wrong for my case) where I want the simulation to appear:
My guess is that this won't work, because I might expect VPython's event loop and PyQt5's event loop would fight with each other. A different approach would be simply to use VPython's widgets, which includes buttons/dropdowns/checkboxes. I'll comment that for VPython questions it's better to post to the VPython forum, where there are many more VPython users who will see your question than if you post to stackoverflow:
https://groups.google.com/forum/?fromgroups&hl=en#!forum/vpython-users

Modifying Windows Frame in Python (The professional way?)

I have been using pyqt and qt designer to make a program. I wanted to custom style the top bar which holds the icon and minimize,resize,close buttons. To do this I started with using the Qt.FramelessWindowHint and making custom buttons and such. This has led to many problems with grabbing corners to resize and also snapping (all the built in windows functions). I was trying to sort through this but found many people talking about the problems that I am having. I was trying to go for the google chrome/maya/photoshop look where the top part is completely customized. A friend pointed out that if any of these programs crash, you can notice the windows bar will show through, which means they are not actually removing it but styling above it or something of that sort. How can I go about doing this so all the functionality is still there but it is styled.

How to add user-resizable images in a textbox for Python GUI

I'm trying to make a word processor type program in python. I'd like the user to be able to open a resizable image into the text area like in MS Word. I've looked into wxpython and tkinter. My understanding is that wxpython doesn't have a feature for images inside textboxes, and I'm not sure if tkinter has a way of letting the user resize the image. Is there a way for me to add this feature using one of the popular GUI toolkits?
Use PyQt. You can achieve lot of things through the highly capable library offered by them.
Another option is to use PyGTK.
Both toolkit also offer GUI building tools for ease of creation.

where is the button widget in pyglet ?

i'm checking out pyglet, but, funny enough, i can't find how to do a simple button!
so
what is the standard way to create a standard button?
is there a standard way to create a Message-Box? open/save dialogs?
or am i missing the point of pyglet? isn't it yet-another gui toolkit
for creating (also) forms, windows, buttons, texts, standard widgets, etc. ?
i'm using Python 2.x on a windows PC if that matters.
I didn't use Pyglet yet, but is not a GUI library, it doesn't have to have widgets like buttons, or containers etc. It's a multimedia library like Pygame, it draws stuff on screen, plays sounds, and has some helper functions.
If you want to draw a button on screen, you should first draw a rectangle, print some text in it, and then listen mouse clicks to know if it's clicked on this rectangle.
See PyQT, PyGTK, WxPython for some examples of GUI libraries.
You can see an example of how to create a button and create yet another interface with Pyglet in the script:
http://www.pyglet.org/doc/programming_guide/media_player.py
But this is only an example interface created without complex items.
Current state of affairs 3 years later...
As previously stated Pyglet itself generally provides a lower level api than the UI widget library (e.g. closer to GDI or SDL).
That said there are gui's built on top of pyglet:
https://github.com/jorgecarleitao/pyglet-gui
https://code.google.com/p/kytten/
Also pyglet 1.2 now has buttons itself (though not much else as far as widgets are concerned).

Categories