Styling Tkinter UI? - python

Is there an easy way to style UI written in python using Tkinter? I need to turn something very basic like this:
Into something styled and more fancy looking like this:
Is there a drag, drop and resize tool that can help me build the UI quickly and efficiently?

Use the ttk widgets. Those are themed.
You can find example of tile (bitmap) based themes here.
Not being a tcl expert, I'm not sure you to get tcl/tk to recognize and load these themes. But here are some pointers.

Related

How to make Tkinter volume slider in a professional way

I'm trying to make a volume controller in python tkinter. But what exactly the problem is that, I want to make it look rich and professional. So when I tried using tkinter scale widget, it worked. But the widget is just a normal one. I wanted to know a way to make it look like the image below I have sent.
My current one's code is this:
def slider(self):
self.scale = scale = ttk.Scale(self.canvas, from_=0, to=100, orient=HORIZONTAL)
print(self.scale.winfo_class())
self.scale.place(x=580,y=455)
self.scale.set(70)
Is there anyway I can make it look better like the one in the Image?
What all things I want is:
A knob like round thing like in the image which is movable
Some color should fill in the area that is already covered.
A pop up or anything to show the current details of the volume.
I'm using pygame to play music in tkinter btw..
If this isn't possible, please suggest me a better way/alternative to do this. Thank you.
As far as I know, there is no existing widget with a look exactly like what you are asking for. However, tkinter provides a way to craft your own widget styles, which might make it possible to do what you want.
Tkinter comes with a module named ttk, which stands for "themed tk". It allows you to define custom styles for individual widgets, and to bundle those styles into a collection known as a theme. If you want to create a widget with a custom look, you can use this module to do so.
Unfortunately, being able to design a custom theme for a widget isn't very well documented. The best documentation I personally know of is on tkdocs.com, in the section Styles and Themes. It gives a pretty good rundown of the terminology and overall description of how themes work. The python documentation for ttk also gives some additional information about creating styles and layouts in a section titled Ttk Styling.
For inspiration, you can check out the code for the ttkthemes project (github, public documentation) which has many different themes that you can examine. I doubt there is one exactly like you want, but you should be able to create your own after looking through the examples.
It is as easy as setting a theme for the TkInter project. Done in Python it looks like that:
s.theme_use('themename')
You might benefit from reading Styles and Themes documentation of TkDocs.

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.

wxpython beautiful widgets

As I was looking into the widget creations tutorial in wxpython. I saw that all of them has the window look but I want a widget like the one you can see on windows 7 (clock widget etc.) or like the one advanced systemcare has.
So my question how can I make such a widget in wxpython if I can at all?
wxPython will look like the OS's native widgets. If you need to do something more advanced, then you'll have to write your own widget. There are lots of examples of custom widgets included with wxPython. Take a look at anything in wx.lib.agw. All of those are custom made widgets, written in Python.
Here are a couple of other links:
http://wiki.wxpython.org/CreatingCustomControls
http://zetcode.com/wxpython/customwidgets/

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.

What is a widget like Intellisense for wxpython

Here is an image of what I am looking for
The best i have found is a popup box.
It would be good if the widget was intended to be used in TextBoxes.
It sounds like you want a text control that has autocomplete. You should take a look at this wxPython wiki recipe:
http://wiki.wxpython.org/TextCtrlAutoComplete
That should get you started.

Categories