ttk

Tkinter / TTK - Prevent string to ButtonPress conversion

余生颓废 提交于 2019-12-10 12:24:13
问题 I'm writing a simple script that creates a ttk Treeview (that acts as a table) and, when you double-click it, it opens a file (with the path saved in the dictionary). However, when you double-click a row you'll get this error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Maicol\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1699, in __call__ return self.func(*args) File "C:\Users\Maicol\Documents\Projects\App_WINDOWS\School_Life_Diary

tkinter progress bar won't update when called from an other app

Deadly 提交于 2019-12-10 12:14:56
问题 I am developing a GUI with tkinter to manage images in a database (import file, load file, query, ...) When a new directory and its sub-directories are scanned for new images to put in the database, a dedicated GUI is launched: It consists of a Text widget where the name of the directory currently analysed is printed, and a progress-bar showing the progress of the scan. When I call this GUI alone, the progressbar updates and progresses correctly as long as I use update() after each change in

When importing modules written with tkinter and ttk, stuff doesn't work

北城以北 提交于 2019-12-10 12:06:58
问题 I'm new to programming, Python, this website, and actually using these kinds of websites in general, so hear me out. I've been writing a module for a larger program using the tkinter module and ttk module, and when I import my own module into the main program, for some reason none of the ttk stuff works as it should. I mean, it appears, but the style I've written for it (s=ttk.Style(); s.configure...etc.) doesn't change it in anyway. When I run the module on its own, everything works fine.

Python Tkinter ttk calendar

夙愿已清 提交于 2019-12-10 11:06:03
问题 I am trying to create a drop down calendar for a date entry. Below is a portion of my code: The drop down portion of it dosen't work and I can't seem to find the syntax for DateEntry() of ttk calendar anywhere to include the calendar widget option! #creating the frame from tkinter import * from tkcalendar import * root = Tk() f1=Frame(root,width=1500,height=100,relief=SUNKEN,bd=4,bg='light steel blue') f1.pack(side=TOP) f2=Frame(root,width=1500,height=550,relief=SUNKEN,bd=4,bg='white') f2

R with tcltk/tcltk2: Improve slow performance when displaying big data.frame with TkTable?

家住魔仙堡 提交于 2019-12-10 10:48:33
问题 Please see two edits below (added later)... I have loaded a big data.frame into memory ( 2.7 mio rows and 7 columns - 74 MB of RAM ). If I want to view the data using Tcl/Tk's Tktable widget via the tcltk2 package function tk2edit it takes over 15 minutes till the window is displayed with the data and about 7 GB of RAM (!) is consumed by R (incl. Tcl/Tk) en plus! Example: library(tcltk2) my.data.frame <- data.frame(ID=1:2600000, col1=rep(LETTERS,100000), col2=rep(letters,1E5), col3=26E5:1) #

Python 2.7 - ttk module seemingly not working in Windows 8.1

冷暖自知 提交于 2019-12-10 09:39:33
问题 My application's GUI is Tkinter based and it is quite functional. I have been trying to use ttk to make it look more modern. I use Python 2.7 in Windows 8.1. Importing ttk goes without error and coding including ttk in the script runs without error. However, the resulting interface looks almost same as the one done only with Tkinter . This is especially true for the buttons. I tried different ttk styles and they almost look same or some worse than Tkinter-only based interface. Tkversion in my

3 Different issues with ttk treeviews in python

狂风中的少年 提交于 2019-12-08 15:48:15
问题 I am doing a chat client using a treeview with multiple columns in Python. This is the code for the treeview : chat = ttk.Treeview(height="26", columns=("Nick","Mensaje","Hora"), selectmode="extended") chat.heading('#1', text='Nick', anchor=W) chat.heading('#2', text='Mensaje', anchor=W) chat.heading('#3', text='Hora', anchor=W) chat.column('#1', stretch=NO, minwidth=0, width=130) chat.column('#2', stretch=NO, minwidth=0, width=620) chat.column('#3', stretch=NO, minwidth=0, width=65) chat

widget in sub-window update with real-time data in tkinter python

帅比萌擦擦* 提交于 2019-12-08 13:29:03
问题 I've tried using the after/time.sleep to update the treeview, but it is not working with the mainloop. My questions are: How can I update the treeview widget with real-time data? And is there a way that I can change all treeview children simultaneously? (I don't want to delete all children and insert again) Script 1: class mainwindow(tk.Tk): #Initalize main window def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) #use to shift frames .... if __name__ == "__main__": ..

Python: Tkinter iconbitmap assignment only works at module level

我们两清 提交于 2019-12-08 09:36:59
问题 I'm using a tkinter.ttk window and I'm using an icon to set the iconbitmap of my window. However root.iconbitmap() is ignored on Windows 10. But There is an easy way to avoid an error: root.tkinter.call('wm', 'iconphoto', root._w, icon) So: from tkinter import * from tkinter.ttk import * root=Tk() root.call('wm', 'iconphoto', root._w, icon) works. BUT : def func(): root=Tk() root.call('wm', 'iconphoto', root._w, icon) does NOT work. An error occurs. It's interesting that that error is exactly

Multiple frames in a single tab ttk.Notebook

邮差的信 提交于 2019-12-08 06:17:30
问题 I have the following sections of code (not complete) where I would like to contain several frames into a single tab in the ttk 'Notebook' . win1 = Tk() n = ttk.Notebook(win1) choice_frame = ttk.Frame(n, style="Black.TLabel") choice_frame.grid(row=2, column=1, sticky="N,S,E,W", padx=1, pady=1) choice_frame.grid_columnconfigure(0, weight=3) choice_frame.grid_rowconfigure(0, weight=1) frame_text = ttk.Frame(n, style="Black.TLabel") frame_text.grid(row=0, column=0, sticky = "N") frame_text.grid