If I understand your code, you are doing everything correctly syntactically. If the value is appearing blank on the screen, the only explanation is that commentEntryVar is a local variable that is being garbage-collected after the widget is created but before the window appears. If it is a local variable,...
python,user-interface,loops,tkinter,ttk
To make your window execute only once and have plus button closing the window do as follow: from Tkinter import * import ttk def plus(*args): value = float(a.get()) value1 = float(b.get()) result.set(value + value1) print "the result is " + str(result.get()) root.destroy() ####### look here !!!####### root = Tk() root.title("Plus...
It is not possible with ttk to do this and it is a horrible design anyway. Instead, create an "options dialog" where you put either a list or a treeview in a panel on the side and use that to select among your many subpages. You can then use a...
This was never implemented. In Tcl/Tk this kind of test can be created using slave interpreters and the entire test environment discarded. In Python I think the nearest equivalent is to create a thread, load Tk in that thread and destroy it following the test. That should isolate the various...
You can try creating a custom theme. import tkinter as tk from tkinter import ttk root = tk.Tk() mygreen = "#d2ffd2" myred = "#dd0202" style = ttk.Style() style.theme_create( "yummy", parent="alt", settings={ "TNotebook": {"configure": {"tabmargins": [2, 5, 2, 0] } }, "TNotebook.Tab": { "configure": {"padding": [5, 1], "background": mygreen }, "map":...
see the following link: Python Docs if you see the select method that should do what you're after, so something like this: notebook.select(tab_id) where the tab id can take a number of forms (see section 24.2.5.3) but the most useful ones are an integer (i think this is the index...
python,tkinter,zip,progress-bar,ttk
After finding the answers not very helpful unfortunately :(. But I have managed to find a example that was very helpful and did exactly what I wanted! It got the percentage of the extraction :). Here is a link to where I found it: Monitor ZIP File Extraction Python Here...
Scrollbars and widgets need a two-way connection. The scrollbar must be able to tell the scrollable widget to scroll, and the widget must be able to tell the scrollbar where and how to draw the thumb. You are not telling the tree widget to update the scrollbar with the information...
I simplified your code and made a working example but you should consider learning Python a bit more before dealing with complex GUI. from tkinter import messagebox, Tk, Menu, ttk news = ['Mid Day News', 'Evening News'] features = ['Calling Farmers', 'Round About Ja', 'You and the Law', 'Get the...
The ttk.Treeview widget has an anchor option you can set for each column. To set the anchor of a column to the right side use: ttk.Treeview.column(column_id, anchor=Tkinter.E) ...
Python 3 and tkinter work perfectly fine with unicode symboles. So you can just use these sympols directly. For example: from tkinter import * from tkinter import ttk root = Tk() backspace = ttk.Button(root, text="←") backspace.grid(row=0, column=0, padx=2, pady=0, sticky="nw") plusminus = ttk.Button(root, text="→") plusminus.grid(row=0, column=1, padx=2, pady=2, sticky="nw") sqroot...
Some of the ttk themes are supported on only one platform. xpnative, winnative, and vista, for example, only work on windows. The "aqua" theme only works on OSX. The others, I think, run on any platform. If you're running via cygwin, the version of python you're running was probably configured...
@fhdrsdg has pointed out the answer where all the class added should have same definition like this : class Page1(Tkinter.Frame): def __init__(self, parent, controller): Tkinter.Frame.__init__(self, parent) class Page2(Tkinter.Frame): def __init__(self, parent, controller): Tkinter.Frame.__init__(self, parent) and so on... You can see that all the page class have the same ascending order...
PanedWindow have a forgetmethod accepting a widget as parameter. In your example, you migh use pwin.forget(bottom)....
You mean something like that? wxPython StaticBox? Will act together with STaticBoxSizer as container for other controls.
Why it happens In the Tk source file generic/ttk/ttkEntry.c, EntryRevalidate() is always run on focus events. This calls EntryValidateChange(), which, when it notices that validation on focus events is "turned off", returns a result indicating that the current value is valid to EntryRevalidate(), which accordingly clears the invalid flag. So,...
python,python-3.x,combobox,tkinter,ttk
At one point in your code self.combovar points to an instance of a StringVar, but later you redefine self.combovar to be a string. The solution is to not redefine self.combovar inside newselection
You can use s.lookup() to get settings of a style. If you want the background setting of your ttk Frame use: s = ttk.Style() bg = s.lookup('TFrame', 'background') Which you can apply to your Canvas: canvas = Canvas(tab, borderwidth=0, background=bg) ...
python,user-interface,tkinter,widget,ttk
You need to do two things: Create a new tkinter.ttk.Style for the button that has its foreground option set to red. Assign the button's style option to this style. Below is a fixed version of your script: from tkinter import * from tkinter import ttk def calculate(*args): try: valuex=int(x.get()) valuey=int(y.get())...
The Tk themeing system redefines widgets in terms of separate visual elements that are composed together using a layout and style configuration options to yield a visual representation of the widget that depends on the chosen theme and the widget state. This allows Tk to request that the Windows Visual...
Unfortunately, there isn't an easy way to change the foreground of a button from the ttk library. It is always the standard Windows gray like in your picture. But you can easily get what you want with a normal tkinter.Button if you set the right options. Below is an example...
python,user-interface,tkinter,ttk
c.get() doesn't always return something like "0.02", it will return "" if there is no user input, in this case it will throw an exceptiong showing error to transfer "" to float. so I modified your code, added something to check the user input. from Tkinter import * import ttk...
The event object that is automatically passed when a bound function is called contains the attribute widget, which is the widget that triggered the event. So you can bind both comboboxes' <<ComboboxSelected>> to trigger self.information (without parentheses) and define that as def information(self, event): combo_var = event.widget.get() print combo_var ...
You can remove this focus mark by altering the sub elements of tab widget. Ttk widgets are decomposed in subelements. The layout of these elements is described through layout method (or in a layout parameter of theme_create). Here is a command to remove layout marks (you can apply it directly...
I can't reproduce your error, but I have an idea what's causing it. My guess is that your OS runs .pyw files using py2. You can double check this in your registry (assuming Windows). Check the following key Computer\HKEY_CLASSES_ROOT\Python.NoConFile\shell\open\command And change its default value to "C:\Python34\pythonw.exe" "%1" %* Or wherever...
The layout for the TFrame does not include a padding element so there is no style element to make use of the configured padding value in your style. You can see this by inspecting the layout: >>> from tkinter import * >>> from tkinter.ttk import * >>> style = Style()...
python,tkinter,color-picker,ttk
Your problem is that you are using a one-dimensional scale for a three-dimensional color space. For what you're looking for, I would suggest using the HSL or HSV color space instead, with the scale in question manipulating the Hue parameter. When you do need RGB values, you can obtain them...
python,user-interface,tkinter,ttk
For ttk widgets you use the state method. The state method for buttons and entry widgets are just a convenience function to mimic the standard button and entry widgets. You can rewrite your function like this: def disable_widgets(parent): for child in parent.winfo_children(): child.state(["disabled"]) ttk states are mentioned in the ttk...