Support
Quality
Security
License
Reuse
kandi has reviewed LayoutManagerGroup and discovered the below as its top functions. This is intended to give you an instant insight into LayoutManagerGroup implemented functionality, and help decide if they suit your requirements.
:point_right: Customize the LayoutManager of RecyclerView(自定义LayoutManager)
Just like a star.
allprojects{
repositories {
...
maven { url 'https://jitpack.io' }
}
}
License
Copyright (C) 2018 DingMouRen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
QUESTION
Correct way to run two Tk() mainloops independently, with second being started from first script?
Asked 2022-Apr-18 at 02:03script_a.py
from tkinter import *
from script_b import test
root = Tk()
var1 = stuff
var2 = stuff
def start_scriptb():
test([var1, var2])
Button(root, text="Start",
command=start_scriptb)
root.mainloop()
script_b.py
from tkinter import *
def test(x):
main = Tk()
Label(main, text=x)
Button(main, text="Exit", command=main.destroy())
main.mainloop()
This is a very basic version of what I'm trying to achieve. I actually am spawning a progress window that uses subprocess.Popen in script 2 with the passed through variables from script one and viewing the progess through a scrolled text widget on the 2nd program. I'm trying to spawn a new process, independent from the root GUI each time that button is hit from script_a.
It works fine in my tests so far, but I wanted to see if this could cause any issues or if this is actually spawning two processes?
I know there should only be one Tk()
per process.
Using a TopLevel()
window to show the progress works fine with the threading module, but the TopLevel()
window will freeze as well as root (and any other open TopLevels()) if root is doing any sort of processing that takes any length of time.
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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Explore Related Topics
Save this library and start creating your kit