tk

Python - Tkinter not support MacOS Mojave Dark Mode

做~自己de王妃 提交于 2019-12-10 14:34:45
问题 I have a problem with the support of Dark Mode on MacOS in python Tkinter. I used python 3.6 with ActiveTlc 8.5 and the Dark Mode works fine, the window titlebar was dark, it's fine for me... but there were some problems with the <MouseWheel> support, then I upgraded python to 3.7.1 and the version of tlc is updated to 8.6 . But now the Dark Mode didn't work, and it's strange, why this is happening? This is an example code: from tkinter import * if __name__ == '__main__': root = Tk() hero

configure 参数详解

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 14:03:51
linux ./configure 的参数详解 ./configure 该脚本将运行一些测试来猜测一些系统相关的变量并检测你的操作 系统的特殊设置,并且最后在制做树中创建一些文件以记录它找到了什么. 缺省设置将制作服务器和应用程序,还有所有只需要C编译器的客户端程序和接口。 缺省时所有文件都将安装到 /usr/local/pgsql. 你可以通过给出下面 configure 命令行选项中的一个或更多的选项来客户化 制作和安装过程: --prefix=PREFIX 把所有文件装在目录 PREFIX下面而不是 /usr/local/pgsql 里.实际的文件会安装到不同的子目录里;甚至没有一个文件会直接 安装到 PREFIX 目录里. 如果你有特殊需要,你还可以用下面的选项客户化不同的子目录 的位置. --exec-prefix=EXEC-PREFIX 你可以把体系相关的文件安装到一个不同的位置, EXEC-PREFIX,而不是 PREFIX 设置的地方.这样做可以比较方便地在不同主机之间共享体系相关的文件. 如果你省略这些,那么 EXEC-PREFIX 就会被设置为等于 PREFIX 并且体系相关和体系无关的文件都会安装到同一棵目录树下, 这也可能是你想要的. --bindir=DIRECTORY 为可执行程序声明目录,缺省是 EXEC-PREFIX/bin, 通常也就是 /usr

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) #

How to replace the Python logo in a Tkinter-based Python GUI app?

烂漫一生 提交于 2019-12-10 09:56:50
问题 Is there a way to change the default logo, which is the Python logo, that appears in the Window's task bar? Notice that I have already successfully replaced the default Tk logo that used to appear in my application window. I am using Windows 7 and Python 2.6 and developing the GUI with the help of Tkinter. 回答1: You can do this using the winico Tk extension package. The winico package can also be used to add system tray icons to Tk programs. The following sample shows one way to do change the

Separating Tkinter UI concerns from Logic in Python app

感情迁移 提交于 2019-12-10 09:41:54
问题 This is my first app ever. It is working well but I would like to separate the UI concerns like getting input and creating labels, from the translation logic. I would then like to remove the output from the previous translation, i.e., only showing one translation on the screen at a time. How can I separate the translation logic from my Tkinter GUI? from Tkinter import * import tkMessageBox def start(): inputg = input.get() if len(inputg) >= 2 and inputg.isalpha(): new_word_out = Label(text=

Python Tkinter Autocomplete combobox with LIKE search?

别等时光非礼了梦想. 提交于 2019-12-10 00:12:37
问题 I am trying to populate a Tkinter combobox with pre-defined values to select from. It is populating and I am able to type in and get suggestions. However, in order to do this I have to definitely know the first few characters. If I know some text in the middle or end of the string, its of no use because the combobox does only a 'LIKE%' search and not a '%LIKE%' search . Expected Output (Typing the word "Ceramic" fetches all names containing the string. Note: This is not a Tkinter screenshot )

Re-binding “select all” in Text widget

假如想象 提交于 2019-12-09 09:33:54
问题 I'm working with the Text widget and I have an issue about old-school shortcuts that Tk uses. Ie: Select all: Ctrl + / vs Ctrl + a Cut: Ctrl + w vs Ctrl + x Copy: Meta + w vs Ctrl + c Paste: Ctrl + y vs Ctrl + v On Windows, all of them work except Ctrl+a. 1) Is it possible to redirect binds, so .bind('<Control-a>') calls already bound Ctrl + /? 2) I tried for "select all": txt_text.bind('<Control-a>', self.ctext_selectall) Where: def ctext_selectall(self, callback): """Select all text in the

Get selected item in listbox and call another function storing the selected for it

我怕爱的太早我们不能终老 提交于 2019-12-09 03:20:55
问题 I have a canvas that calls createCategoryMeny(x) when it is clicked. This function just creates a Toplevel() window, def createCategoryMenu(tableNumber): ##Not interesting below: categoryMenu = Toplevel() categoryMenu.title("Mesa numero: " + str(tableNumber)) categoryMenu.geometry("400x400+100+100") categoryMenu.focus() categoryMenu.grab_set() Label(categoryMenu, text="Elegir categoria \n Mesa numero: " + str(tableNumber)).pack() ## RELEVANT CODE BELOW: listbox = Listbox(categoryMenu, width

Limiting scroll bar length

帅比萌擦擦* 提交于 2019-12-08 20:03:41
问题 I am trying to create a simple notepad like GUI using Perl Tk. I have used the Scrolled widget to create a Text widget with two scrollbars - one on the right and one on the bottom. The place where the two scrollbars meet looks like this: However I would like to make it look like what is seen in the "Notepad" application by Microsoft. This is how I want it: As you can see, there is a now an "empty square" where the two scrollbars meet. One more feature of notepad is that this "square" can be

Tkinter grid geometry manager size propagation (with sticky)

ⅰ亾dé卋堺 提交于 2019-12-08 16:27:38
问题 I'm missing something about how sizes propagate in Tk. Try this: from Tkinter import * root = Tk() frame1 = Frame(root, border=4, relief=RIDGE) frame1.grid(sticky=E+W) frame2 = Frame(root, border=4, relief=RIDGE) frame2.grid(sticky=E+W) label1 = Label(frame1, text='short', background='white') label1.grid(sticky=E+W) label2 = Label(frame2, text='quite a bit longer', background='white') label2.grid(sticky=E+W) root.mainloop() label1 is inside frame1, and label2 is inside frame2. label1 comes