tk

How can I use matplotlib's mathtext rendering outside of matplotlib in another tk widget?

自古美人都是妖i 提交于 2019-12-14 01:28:49
问题 I know that matplotlib can render math expressions readily with, for instance, txt=Text(x,y,r'$\frac{1}{2}') which would make the fraction 1 over 2 at x,y. However, instead of placing the text at x,y I would like to use the rendered string in a separate tk application (like an Entry or Combobox). How can I obtain the rendered string from matplotlib's mathtext and put it into my tk widget? Of course I would welcome other options that would render the latex strings into my tk widget without

Python Tkinter scrollbar in multiple tabs

独自空忆成欢 提交于 2019-12-13 22:23:31
问题 I learned how to make a scrollable frame by embedding the frame in a canvas and then adding a scrollbar to it like this: def __add_widget_features(self, feat_tab): table_frame = ttk.Frame(feat_tab) table_frame.pack(fill=BOTH, expand=True) self.__make_grid(table_frame) ####subframe#### self.canvas = Canvas(table_frame, borderwidth=0, background="#ffffff") self.frame = LabelFrame(self.canvas, background="#ffffff", text="Timetable") self.vsb = ttk.Scrollbar(table_frame, orient="vertical",

global variable issues with tkinter python

只谈情不闲聊 提交于 2019-12-13 16:40:17
问题 I am trying to create a simple interface to access the name array with first, last, previous and next functionality. But the global variable I am using as a position tracker is not working. I have already referred to various question. Would really appreciate the help. Here is the code. from tkinter import Tk, Label, Entry, Button, StringVar, IntVar window = Tk() name_array = [('a1','a2','a3'), ('b1','b2','b3'), ('c1','c2','c3'),('d1','d2','d3')] global position_track position_track = IntVar()

How to get name of TCL test from the test itself

白昼怎懂夜的黑 提交于 2019-12-13 15:18:31
问题 I was wondering how you would find the name of the test you're running in tcl from the test itself? I couldn't find this on google. I'm calling another proc and passing the name of the test that is calling it, as an argument. So I would like to know which tcl command can do that for me. 回答1: This isn't an encouraged use case… but you can use info frame 1 to get the information if you use it directly inside the test. proc example {contextTest} { puts "Called from $contextTest" return ok }

Python: Getting started with tk, widget not resizing on grid?

情到浓时终转凉″ 提交于 2019-12-13 15:04:38
问题 I'm just getting started with Python's Tkinter / ttk and I'm having issues getting my widgets to resize when I use a grid layout. Here's a subset of my code which exhibits the same issue as the full code (I realize that this subset is so simple that I'd probably be better off using pack instead of grid , but I figure this will help cut through to the main problem and once I understand, I can fix it everywhere it occurs in my full program): import Tkinter as tk import ttk class App(tk.Frame):

Tk - segfaults when I use widget (button, text)

感情迁移 提交于 2019-12-13 04:51:52
问题 I have compiled Tcl/Tk into my application. When I open my application, I get a window (due to Tk_init) which I can manipulate: > wm title . "mysh" > wm geometry . 300x300 But when I try button or any of the other widgets it segfaults > button .b Segmentation fault I loaded this in gdb and ran a back trace Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 182897358752 (LWP 14112)] 0x0000000100000000 in ?? () (gdb) bt #0 0x0000000100000000 in ?? () #1 0x0000000000fe3004

Find precompiled or compile Tcl/Tk Frameworks for macOS

送分小仙女□ 提交于 2019-12-13 04:39:45
问题 I am a beginner with Tcl/Tk, but I am already in need to deploy an .app with Tcl/Tk frameworks in it (because the .app needs to rely on its own Tcl/Tk version and not on macOS standard and old Tcl/Tk). Can somebody point me to where I can find precompiled Frameworks or to a step-by-step guide on how to compile them on macOS? Half a day of search has not been very fruitful in this regard. I guess my need is not at all very special, as I see many .apps shipping their own Tcl/Tk Frameworks. (PS:

WordNet: file was built for i386 which is not the architecture being linked (x86_64)

做~自己de王妃 提交于 2019-12-13 01:36:10
问题 I get the following error when running make trying to compile WordNet 3.0: gcc -m64 -g -O2 -o wishwn wishwn-tkAppInit.o wishwn-stubs.o -L../lib -lWN - F/Library/Frameworks -framework Tk -F/Library/Frameworks -framework Tcl -lpthread -framework CoreFoundation -framework Cocoa -framework Carbon -framework IOKit -lz -lpthread -framework CoreFoundation ld: warning: ignoring file /Library/Frameworks/Tk.framework/Tk, file was built for i386 which is not the architecture being linked (x86_64):

Rstudio specific issue with the tcltk package

会有一股神秘感。 提交于 2019-12-12 19:10:12
问题 I am trying to compile an interactive code that prompts for user input. I used the tcltk package for various dialog boxes and everything seemed to work fine, until it stopped working today. It should be noted that a) I did not change anything in terms of configuration and b) it only stopped working in RStudio but it still work in R. Let's say I use the following code for example: library(tcltk) a <-tkmessageBox(title = "Remove stuff from dataset", message = "Would you like to remove stuff

Setting “tk scaling” in Tkinter affects widgets but not text

心已入冬 提交于 2019-12-12 15:17:19
问题 I'm trying to use Tk's "tk scaling" feature to zoom a GUI but it only seems to change the size of the widgets, not the text. Is it possible to use "tk scaling" with Tkinter and have it work appropriately? Here's my test script: #!/usr/bin/python from Tkinter import * root = Tk() root.tk.call('tk', 'scaling', '-displayof', '.', 50) root.geometry('640x480+0+0') label = Label(root, text='THis is some text') button = Button(root, text='my button', command=root.quit) label.pack() button.pack()