user-interface

Tkinter GUI app runs slower as time goes on

你离开我真会死。 提交于 2021-01-05 04:47:53
问题 I am designing a GUI that shows the number of packets on a node at a given cycle. The program adds one to the counter every loop and updates the GUI with the new info, so that every ~0.1 seconds a different layout is drawn by the GUI. There are 7 different layouts, and when the program gets to layout 7 it goes back to 0, creating an infinite loop of the 7 layouts. This is intended. The problem is the program runs slower as time goes on, i.e. it takes about 0.101 seconds to increment from 0 to

How to force the gmail inbox to reload/refresh?

不打扰是莪最后的温柔 提交于 2021-01-01 06:28:53
问题 I have built an application that uses the import endpoint in the Gmail API Gmail.Users.Messages.import() to clone an email message but allow for subject changing. It then deletes the original/old message using the remove endpoint Gmail.Users.Messages.remove() I would like a way to refresh the Gmail inbox UI or even to just reload the web page from Google Apps Script - however, I'm not aware of how to do this - and a look around the internet hasn't proven especially helpful. 回答1: Unfortunately

Make QDialog modal to operating system

限于喜欢 提交于 2020-12-31 20:08:44
问题 Is it possible that if a QDialog instance is exec() uted, the entire operating system is blocked until the user closes the dialog? In the following minimal example the dialog blocks only its parent widget but not the OS elements outside of the Qt application. rootwindow.h #ifndef ROOTWINDOW_H #define ROOTWINDOW_H #include <QApplication> #include <QMainWindow> #include <QtDebug> #include <QDialog> #include <QPushButton> #include <QMessageBox> #include <QBoxLayout> class RootWindow : public

Make QDialog modal to operating system

狂风中的少年 提交于 2020-12-31 20:06:33
问题 Is it possible that if a QDialog instance is exec() uted, the entire operating system is blocked until the user closes the dialog? In the following minimal example the dialog blocks only its parent widget but not the OS elements outside of the Qt application. rootwindow.h #ifndef ROOTWINDOW_H #define ROOTWINDOW_H #include <QApplication> #include <QMainWindow> #include <QtDebug> #include <QDialog> #include <QPushButton> #include <QMessageBox> #include <QBoxLayout> class RootWindow : public

Make QDialog modal to operating system

断了今生、忘了曾经 提交于 2020-12-31 20:02:22
问题 Is it possible that if a QDialog instance is exec() uted, the entire operating system is blocked until the user closes the dialog? In the following minimal example the dialog blocks only its parent widget but not the OS elements outside of the Qt application. rootwindow.h #ifndef ROOTWINDOW_H #define ROOTWINDOW_H #include <QApplication> #include <QMainWindow> #include <QtDebug> #include <QDialog> #include <QPushButton> #include <QMessageBox> #include <QBoxLayout> class RootWindow : public

Is it possible to have a red squiggly line appear under words in a Tkinter text widget without using canvas? (Like for misspelled words)

北城以北 提交于 2020-12-29 09:05:35
问题 As per the question title: Is it possible to have a red squiggly line appear under words in a Tkinter text widget without using a canvas widget? (The same squiggle as when you misspell a word) I'm going for something like this: If so where would I start? 回答1: This is just an example of using user-defined XBM as the bgstipple of part of the text inside a Text widget to simulate the squiggly line effect: create a XBM image, for example squiggly.xbm , like below: A XBM with 10x20 pixels then you

Explanation of need for Multi Threading GUI programming

爷,独闯天下 提交于 2020-12-29 03:57:12
问题 I'm looking for a good explanation of the need to use multi-threading in graphical applications. In the examples below Python is used but the question is not python specific it applies to maybe the general design of graphical programming in any language. Lets take a simple example. Let's assume there is an application that does some sort of time consuming operation on a collection of files, and that it outputs it's progress to the console. Lets assume that this operation takes 2 seconds per

NSTableColumn size to fit contents

狂风中的少年 提交于 2020-12-29 03:46:47
问题 I am developing in and against Mac OS X 10.6 (Snow Leopard). When I double-click between two of my NSTableView's column headers, the column on the left autosizes, like you would expect. I want to provide this in a context menu as well, but it seems there is no publicly accessible function to do this. I've Googled, and looked at the documentation for NSTableView, NSTableHeaderView, and NSTableColumn, but found nothing. I find it hard to believe they wouldn't expose something so useful when

NSTableColumn size to fit contents

给你一囗甜甜゛ 提交于 2020-12-29 03:46:27
问题 I am developing in and against Mac OS X 10.6 (Snow Leopard). When I double-click between two of my NSTableView's column headers, the column on the left autosizes, like you would expect. I want to provide this in a context menu as well, but it seems there is no publicly accessible function to do this. I've Googled, and looked at the documentation for NSTableView, NSTableHeaderView, and NSTableColumn, but found nothing. I find it hard to believe they wouldn't expose something so useful when

What is the difference between the Control.Enter and Control.GotFocus events?

爱⌒轻易说出口 提交于 2020-12-28 12:59:12
问题 This may be a basic question, but I have to admit I've never truly understood what the difference between the Control.Enter and Control.GotFocus events is. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.enter.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.control.gotfocus.aspx Is it a differentiation between capturing keyboard or mouse input or something else? 回答1: The GotFocus/LostFocus events are generated by Windows messages, WM_SETFOCUS and WM