tk | The Tk Widget Toolkit For Tcl | Natural Language Processing library
kandi X-RAY | tk Summary
kandi X-RAY | tk Summary
This is the Tk 8.7a6 source distribution. You can get any source release of Tk from our distribution site. 8.6 (production release, daily build) 8.7 (in development, daily build)). This directory contains the sources and documentation for Tk, a cross-platform GUI toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with this release, see the Tcl/Tk 8.7 Web page or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. Tk is maintained, enhanced, and distributed freely by the Tcl community. Source code development and tracking of bug reports and feature requests take place at core.tcl-lang.org. Tcl/Tk release and mailing list services are hosted by SourceForge with the Tcl Developer Xchange hosted at www.tcl-lang.org. Tk is a freely available open-source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. See the file license.terms for complete information. Please see the README.md file that comes with the associated Tcl release for more information. There are pointers there to extensive documentation. In addition, there are additional README files in the subdirectories of this distribution.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tk
tk Key Features
tk Examples and Code Snippets
def __init__(self, master):
global pass_count, answer, country_img
global df, pass_window
tk.Frame.__init__(self, master)
filename = random.choice(os.listdir("./images"))
code = filename.split(".")[0]
def __init__(self, master):
tk.Frame.__init__(self, master)
ImagePath = 'halloween.png'
canv = tk.Canvas(self, width=600, height=500, bg='white')
canv.pack(side='bottom')
self.img = ImageTk.PhotoImage(Image.op
def __init__(self, master):
tk.Frame.__init__(self, master)
ImagePath = 'halloween.png'
canv = tk.Canvas(self, width=600, height=500, bg='white')
canv.pack(side='bottom')
self.img = ImageTk.PhotoImage(Image.op
Community Discussions
Trending Discussions on tk
QUESTION
script_a.py
...ANSWER
Answered 2022-Apr-18 at 02:03With many hours of testing, I did have success in running two Tk() loops, but it had potential to be problematic, as "Bryan Oakley" had posted in many threads about.
Ultimately, I decided when I was in need of running something alone, I'd start my GUI with arguments and process it in an entirely new process instead of passing any arguments directly. Seems like a safer option.
QUESTION
I know that menu.tk_popup() can be used to open a context menu at a certain coordinate, but don't know how to open a submenu out of it too, if that makes sense. This is the code I made:
...ANSWER
Answered 2022-Apr-12 at 06:22So the question is, how do I make it so when middle-clicking, it opens the first menu AND then automatically runs the cascade, as if it was clicked?
Considering this answer by Bryan Oakley and the documentation available on the internet, there is no way for making a menu and a submenu visible simultaneously. "That's just not how Tkinter menus are designed to work."
You will have to create a customized menu bar without using the widget tk.Menu
.
When I middle-click, I tried to make it so it displays both the menus (my_menu, my_menu2), but my attempt just displays both but with the first menu overlapping, so the other doesn't show.
They are not overlapping. Even if you add some gap to the x-y values using some integers, still you won't be seeing the second menu.
The reason is that using tk_popup
or post
will make the menu appear on the screen for sure, but then the program's focus gets shifted to the user's mouse and keyboard. So, until the user clicks out of the focus of that menu, the program won't be coming out to execute the next lines of the function (in which you are calling the tk_popup for the submenu.)
Here you can see what I mean:
QUESTION
I have created a GUI app in Python tkinter for analyzing data in my laboratory. There are a number of buttons, figures, and canvas widgets. It would be helpful to take a screenshot of the entire window ('root') using just a single button that saves the filename appropriately. Example using Mac's built-in "screenshot" app here.
Related questions here, here, and here, but none worked successfully. The final link was almost successful, however the image that is saved is my computer's desktop background. My computer is a Mac, MacOS Monterey 12.0.1.
'root' is the tkinter window because
...ANSWER
Answered 2022-Jan-14 at 22:44First, I didn't have an issue with the grab showing my desktop, but it was showing an improperly cropped image.
I have found a hacky solution. The issues appears to be with the resolution. So the dimensions need some scaling.
What I did was get the output from ImageGrab.grab().save(full_file_name)
( no cropping ) and measure the size of the desired image area in pixels. These dimensions will be called x_pixels
and y_pixels
.
Then I measured that same area on the actual window in screen units. I did this by bringing up the mac screenshot tool which shows the dimensions of an area. I then call these dimensions x_screen
and y_screen
. Then I modified your screenshot function as follows.
QUESTION
I made a Fourier Series/Transform Tkinter app, and so far everything works as I want it to, except that I am having issues with the circles misaligning. Here is an image explaining my issue (the green and pink were added after the fact to better explain the issue):
I have narrowed down the problem to the start of the lines, as it seems that they end in the correct place, and the circles are in their correct places. The distance between the correct positions and the position where the lines start seems to grow, but is actually proportional to the speed of the circle rotating, as the circle rotates by larger amounts, thus going faster.
Here is the code:
...ANSWER
Answered 2022-Mar-05 at 20:55The main problem that you are facing is that you receive floating point numbers from your calculations but you can only use integers for pixels. In the following I will show you where you fail and the quickest way to solve the issue.
First your goal is to have connected lines and you calculate the points here:
QUESTION
I have a checkbutton:
...ANSWER
Answered 2022-Mar-04 at 15:23You can bind the left mouse button click event of the label, to a lambda construct that toggles the checkbutton -:
QUESTION
I'm using docker-compose
to launch a commandbox lucee container and a mysql contianer.
I'd like to change the web root of the lucee server, to keep all my non-public files hidden (server.json etc, cfmigrations resources folder)
I've followed the docs and updated my server.json
https://commandbox.ortusbooks.com/embedded-server/server.json/packaging-your-server
ANSWER
Answered 2022-Feb-24 at 15:19You're using a pre-warmed image
QUESTION
I have a local python project called jive
that I would like to use in an another project. My current method of using jive
in other projects is to activate the conda env for the project, then move to my jive
directory and use python setup.py install
. This works fine, and when I use conda list
, I see everything installed in the env including jive
, with a note that jive
was installed using pip.
But what I really want is to do this with full conda. When I want to use jive
in another project, I want to just put jive
in that projects environment.yml
.
So I did the following:
- write a simple
meta.yaml
so I could use conda-build to buildjive
locally - build jive with
conda build .
- I looked at the tarball that was produced and it does indeed contain the
jive
source as expected - In my other project, add jive to the dependencies in
environment.yml
, and add 'local' to the list of channels. - create a conda env using that environment.yml.
When I activate the environment and use conda list
, it lists all the dependencies including jive
, as desired. But when I open python interpreter, I cannot import jive
, it says there is no such package. (If use python setup.py install
, I can import it.)
How can I fix the build/install so that this works?
Here is the meta.yaml, which lives in the jive
project top level directory:
ANSWER
Answered 2022-Feb-05 at 04:16The immediate error is that the build is generating a Python 3.10 version, but when testing Conda doesn't recognize any constraint on the Python version, and creates a Python 3.9 environment.
I think the main issue is that python >=3.5
is only a valid constraint when doing noarch
builds, which this is not. That is, once a package builds with a given Python version, the version must be constrained to exactly that version (up through minor). So, in this case, the package is built with Python 3.10, but it reports in its metadata that it is compatible with all versions of Python 3.5+, which simply isn't true because Conda Python packages install the modules into Python-version-specific site-packages
(e.g., lib/python-3.10/site-packages/jive
).
Typically, Python versions are controlled by either the --python
argument given to conda-build
or a matrix supplied by the conda_build_config.yaml
file (see documentation on "Build variants").
Try adjusting the meta.yaml
to something like
QUESTION
In vuejs2 app having select input with rather big options list it breaks design of my page on extra small devices. Searching in net I found “size” property, but that not what I I need : I want to have dropdown selection, which is the default. Are there some other decision, maybe with CSS to set max-height of dropdown selection area.
Modeified PART # 1: I made testing demo page at http://photographers.my-demo-apps.tk/sel_test it has 2 select inputs with custom design and events as in this example link How to Set Height for the Drop Down of Select box and following workaround at js fiddle:
...ANSWER
Answered 2022-Jan-15 at 16:00Unfortunately, you cannot chant the height of a dropdown list (while using ).
It is confirmed here.
you can build it yourself using divs & v-for (assuming you get the list from an outsource) and then you can style it as you wish.
apologies for barring bad news.
QUESTION
The 3 example files executable are: main.py
, page1.py
and external_class.py
. The main.py file is used to start the main GUI and the page1.py file contains the class in which I import another class from the external_class.py file.
The problem is that the External class of the external_class.py file is unable to execute an element of the Page1 class of the page1.py file. The element is obtained from the combobox present in the Page1 class of the page1.py file, so I don't want to rewrite the code from scratch in the External class of the external_class.py file, but I just want the External class to recognize the select_only_way element.
In the External class of the external_class.py file, I use select_only_way
like this self.cursor.execute ('SELECT a, b FROM other WHERE a = ?', [Select_only_way])
. The problem is right here, in the External class of the external_class.py file.
I get error in the External class of the external_class.py file.
...ANSWER
Answered 2022-Jan-19 at 18:14The basic problem is that you have not created a reference to the attribute.
First of all, care should be taken to prefix all attributes inside a new object (class Page1 __init__) with self.
in front of all attributes.
This makes the value part of the object and
can be called after the initialization.
In your case, the entire class could be passed as an argument to External.
QUESTION
Python 3.9 on Mac running OS 11.6.1. My application involves placing a plot on a frame inside my root window, and I'm struggling to get the plot to take up a larger portion of the window. I thought rcParams
in matplotlib.pyplot
would take care of this, but I must be overlooking something.
Here's what I have so far:
...ANSWER
Answered 2022-Jan-14 at 23:23try something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tk
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page