tk

Display the tail of a filename in an entry box

筅森魡賤 提交于 2019-12-22 16:43:34
问题 I regularly find myself writing Tk dialog boxes using ttk::entry widgets to prompt for a filename. I save the user's last input to such a dialog and display it as the default when next displaying it. After I've populated the widget, if the full filename is longer than the entry box, then it will display the leftmost few characters which are generally the less interesting part of the filename and I'd rather it displayed the rightmost characters. I found that attempting to use $entryWidget

Graphing routines in Tcl/Tk

ぃ、小莉子 提交于 2019-12-22 11:33:04
问题 I want to do simple graphing routines in Tcl/Tk like scatter plot, x-y plot, histograms. I am using Tcl/Tk 8.5.7. I found in Tcler's wiki that there are few options such as BLT which is not supported in Tcl/Tk 8.5+ Is there any Tcl/Tk interface to gnuplot or any widget to accomplish graphing? Please let me know about the choices for graphing routines in Tcl/Tk. 回答1: Gnuplot can indeed produce output that Tcl/Tk can consume. This page on the Tcler's Wiki describes how (though with some extra

[Python/Tkinter]How can I fetch the value of data which was set in function “event_generate”

你。 提交于 2019-12-22 10:37:31
问题 I'm using Python 2.7.4 and new to Tkinter, and I'm stuck with the following code. I generated an event "test" and set the "data" option with a string, but an error occurred when retrieving it from event. Error -> AttributeError: Event instance has no attribute 'data' from Tkinter import * def handle_it(event): # print "event handler" print event.data root = Tk() root.after(1, lambda: root.event_generate('<<test>>', data="hi there")) root.bind('<<test>>', handle_it) root.mainloop() I can't

Tcl/Tk - automating GUI testing

☆樱花仙子☆ 提交于 2019-12-22 01:30:55
问题 I want to automate the testing of my GUI. I went through the following post but if someone can post a sample test code for the following example it would be much easier for me to understand. The following is my simple Hello World code. namespace eval Gui { } proc Gui::hello {} { toplevel .hello wm title .hello "Hello" wm resizable .hello 0 0 ;# not resizable # create a frame to hold the check widgets set f [frame .hello.boolean -borderwidth 10] pack $f -side top # OK and Cancel buttons button

Displaying data in a pop up window (table widget) using tcltk in R - why is it dropping the last row of data?

亡梦爱人 提交于 2019-12-21 20:38:51
问题 I'm struggling with creating a widget to view a table in a pop up window using tcl/tk. I'm following this example: http://r.789695.n4.nabble.com/Tck-tk-help-td1837711.html But when I run the script with my data the last row of data is not included in the array. Here is an example with the cars data (it doesn't matter that the table does not show the row names): require(tcltk) tclRequire("Tktable") toTclArray<-function(dsn,dig=2) { # http://r.789695.n4.nabble.com/Tck-tk-help-td1837711.html #

TclTk library issue while install Rcmdr package on MacBookPro [duplicate]

我的未来我决定 提交于 2019-12-21 17:24:23
问题 This question already has answers here : Error “.onLoad failed in loadNamespace() for 'tcltk'” (6 answers) Closed 4 years ago . I get the following ERROR while trying to load Rcmdr for R on my MacBook Pro: > library("Rcmdr") Error : .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so': dlopen(/Library/Frameworks/R.framework

Creating Ruby applications for Windows

别说谁变了你拦得住时间么 提交于 2019-12-21 09:27:00
问题 I want to develop a Windows application. Honestly I care little about cross-platforms for now (but still would be good) I want to use Ruby, since it has quite a simple syntax and is so.. well, simple and easy to learn. My application is like a "game level creator", where you can design your own level and then run it with another application which is a "game level player" by reading the project file created by the creator app. You get the idea. Now, I got a new PC and is completely clean.

tkinter/py2app created application doesn't show window on initial launch

与世无争的帅哥 提交于 2019-12-21 05:13:13
问题 I'm running into an issue where launching a python app created with Tkinter and packaged by py2app doesn't show the application window immediately. The only way I've gotten the window to show after launch is to click on the application icon in the dock. This guy is using an applescript to auto-click the app on launch but as he states, and I agree, it isn't ideal. 回答1: After doing some extensive research, it would appear that this is a result of setting the 'argv_emulation' option to True in

from matplotlib.backends import _tkagg ImportError: cannot import name _tkagg

非 Y 不嫁゛ 提交于 2019-12-21 03:37:12
问题 While trying to run this example to test how matplotlib works with Tkinter, I am getting the error: (env)fieldsofgold@fieldsofgold-VirtualBox:~/new$ python test.py Traceback (most recent call last): File "test.py", line 7, in <module> from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg File "/home/fieldsofgold/new/env/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 13, in <module> import matplotlib.backends.tkagg as tkagg File

Background color for Tk in Python

十年热恋 提交于 2019-12-20 09:51:04
问题 I'm writing a slideshow program with Tkinter, but I don't know how to change the background color to black instead of the standard light gray. How can this be done? import os, sys import Tkinter import Image, ImageTk import time root = Tkinter.Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, h)) root.focus_set() root.bind("<Escape>", lambda e: e.widget.quit()) image = Image.open(image_path+f) tkpi = ImageTk.PhotoImage