window

How to run pynput.Listener simultaneously with tkinter.Tk().mainloop()

*爱你&永不变心* 提交于 2020-02-25 05:51:21
问题 I am a teacher. I teach math, but since education is facing human resources crisis, I have some additional duties. I teach kids a bit of programming, they do quite well. Now I'd like to make with them a snake game, but I have a problem achieving multithreading in my GUI app. I found similar cases but no solutions. Like here: Using the keyboard to move the character in a maze and here: Tkinter.Tk() and threading def on_press(key): print('{0} pressed'.format(key)) def on_release(key): if key ==

C# WPF How to close a new window correctly?

百般思念 提交于 2020-02-23 14:47:20
问题 I have a simple question: Create a new WPF project, there's startup window in it(MainWindow.xaml). in this project, create a new Window(Window1.xaml) Windows1's loaded event, let it close: private void Window_Loaded(object sender, RoutedEventArgs e) { this.Close(); } put a "Open" button to MainWindow, implement it's click event: private void button_Click(object sender, RoutedEventArgs e) { Window1 w = new Window1(); w.Show(); } when I start this application, VS2015's UI became to the

C# WPF How to close a new window correctly?

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-23 14:45:38
问题 I have a simple question: Create a new WPF project, there's startup window in it(MainWindow.xaml). in this project, create a new Window(Window1.xaml) Windows1's loaded event, let it close: private void Window_Loaded(object sender, RoutedEventArgs e) { this.Close(); } put a "Open" button to MainWindow, implement it's click event: private void button_Click(object sender, RoutedEventArgs e) { Window1 w = new Window1(); w.Show(); } when I start this application, VS2015's UI became to the

get current focused window id using objective c

♀尐吖头ヾ 提交于 2020-02-23 07:14:50
问题 how can i get current focused window id using objective c, the return value should be an int, help is highly appreciated! I just need to get the following line working CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, winNum, kCGWindowImageBoundsIgnoreFraming); but no matter which window that i focus at, winNum is always 0. 回答1: NSWindow *keyTarget = [[NSApplication sharedApplication] keyWindow]; NSInteger winNum = [keyTarget windowNumber]; or in

get current focused window id using objective c

可紊 提交于 2020-02-23 07:12:03
问题 how can i get current focused window id using objective c, the return value should be an int, help is highly appreciated! I just need to get the following line working CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, winNum, kCGWindowImageBoundsIgnoreFraming); but no matter which window that i focus at, winNum is always 0. 回答1: NSWindow *keyTarget = [[NSApplication sharedApplication] keyWindow]; NSInteger winNum = [keyTarget windowNumber]; or in

get current focused window id using objective c

倖福魔咒の 提交于 2020-02-23 07:12:01
问题 how can i get current focused window id using objective c, the return value should be an int, help is highly appreciated! I just need to get the following line working CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, winNum, kCGWindowImageBoundsIgnoreFraming); but no matter which window that i focus at, winNum is always 0. 回答1: NSWindow *keyTarget = [[NSApplication sharedApplication] keyWindow]; NSInteger winNum = [keyTarget windowNumber]; or in

Custom button in WPF window Titlebar

可紊 提交于 2020-02-23 03:52:28
问题 I like to add a custom button in WPF Native Window title bar without editing the style of the Window. Is it possible? If yes, please share some ideas. Regards, Jawahar 回答1: Mahapps is a UI toolkit for WPF and they make this super easy: mahapps.com Easy install using NuGet GUI or the Packet Manager console: PM> Install-Package MahApps.Metro I was able to do the install and customization in less than half hour with Mahapp. 来源: https://stackoverflow.com/questions/9013346/custom-button-in-wpf

Creating a transparent overlay with qt

穿精又带淫゛_ 提交于 2020-02-12 16:44:39
问题 I've been learning python recently and now I wanted to (try to) create my first real application, a subtitle player for Linux. So far I've been using the Greenfish subtitle player, which is aimed at Windows users and not properly working in Linux. I wanted to create the application in qt, since I discovered that transparent windows are not possible in tkinter, but if anybody knows a better framework please suggest! Now before starting I've been researching the web for several hours to

How to get this window layout in WPF?

醉酒当歌 提交于 2020-02-11 09:31:10
问题 im trying to create a Window with the following layout: Layout http://www.x-toolz.com/downloads/layout.jpg As you can see the window has 3 rows (15*, 70*, 15*) and 3 columns (same). How can I redesign a rectangle to fit the geometry of the corners? If it can't be done with rectangles i would need another control that I can place content (Grid, StackPanel) in. Any Ideas? Thanks in advance! MemphiZ 回答1: <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006

Chat Client emoticons window JAVA

不羁岁月 提交于 2020-02-09 01:57:05
问题 I've been working on creating a chat client(java swing) and I've just made my emoticons fully useable but other than having users type ":)" for example, I want to provide a popup window with all the available emoticons. What I'm searching for is a way to make such a window( for example like Skype's). How and with what can I go about it? I've tried with a JMenu, but it doesn't do what I want. I want to put a small image(probably emoticon) near the enter text area and when it's clicked, a