user-interface

GUI Freezes when clicking a button in PyGtk

本小妞迷上赌 提交于 2021-02-11 13:10:33
问题 I know this may be a recurring question, but I don't get the point in the other answers to that problem. First of all, here is my code (if you want syntax highlighting) : http://pastebin.com/9uJah8t2 #!/usr/bin/python2.7 from mega import Mega import pygtk import gtk import glib class HelloWorld: #def onSuccess(self, widget, data): def test(self, widget, data): email = self.login.get_text() password = self.password.get_text() mega = Mega() m = mega.login(email, password) details = m.get_user()

What's the best way to create a new UI thread and call back methods on the original thread?

你。 提交于 2021-02-11 12:49:35
问题 I'm writing a plug-in class for a third-party GUI application. The application calls the Run method of my class, passing me a vendor-defined Context object. Any methods or properties in this Context object must be called from the current thread (that is, the application's UI thread). My plug-in code creates a WPF Window and shows it to the user. Some interactions need to call the Context object's methods, but some take time to run. This, of course, freezes my UI. Normally, I would call slow

Wack-A-Mole for school - Python

可紊 提交于 2021-02-11 12:40:51
问题 The command destroymole() is unable to run without mole = tk.Button(root, ...) , but mole can't run without destroymole() How can I get them to be defined for the other one at the same time? import tkinter as tk import random root = tk.Tk() canvas = tk.Canvas(root, height=600, width=700, bg="#4f75b3") canvas.pack() frame = tk.Frame(root, bg="#66bd5e") frame.place(relx=0.075,rely=0.075,relheight=0.85,relwidth=0.85,) def destroymole(): mole.destroy() mole = tk.Button(root, text="MOLE",relief=

Running a cmd file without GUI popping up

断了今生、忘了曾经 提交于 2021-02-11 12:38:24
问题 I'm running a list of commands in a file: matlab -nodesktop -nodisplay -nojvm -nosplash ............. xwin32 --session .................... I would like to have them run without the GUI popping up in Windows and more of all I would like the command prompt GUI not to pop up, anyone have any idea how to do it? tnx 回答1: Best you can do on Windows is: batchScript.cmd start /B /MIN matlab.exe -nodesktop -noFigureWindows -nosplash ^ -r "surf(peaks); saveas(gcf, 'output.eps'); quit;" You can add the

Clicking a button to create a new button using PyQt5 python [duplicate]

这一生的挚爱 提交于 2021-02-11 12:33:54
问题 This question already has answers here : QLabel does not display in QWidget (2 answers) Closed 1 year ago . I'm trying to create a window(UI) that have a button click action implemented using python and PyQt5 . But, i want my button to create a new button when i clicked it. (i.e: clicking a button to create a new button). Can some one notify me on how to do that? my sample code is as follows: from PyQt5.QtWidgets import QApplication, QWidget, QPushButton from PyQt5.QtGui import QIcon from

Use a slider in MATLAB GUI

南楼画角 提交于 2021-02-11 12:15:27
问题 Really simple question. I wish to create GUI with a simple plot that changes something with a slider. I have been using the GUI and have a slider+text on a panel and axies1. So for starters I just wish to have the slider going from 1:10 (no specific increments) and scaling the y-values (by 1:10). I have imported my data into the GUI, so leaving out the generic auto-generate code I have: Under Graphslide_OpeningFcn handles.OutAirTemp = OutAirTemp; handles.SupAirTemp = SupAirTemp; guidata

Running a Windows executable (calc.exe, etc) inside a PyQt Application

时光怂恿深爱的人放手 提交于 2021-02-11 06:49:08
问题 I'm trying to run a Windows executable inside my application written in Python using PyQt5. I'm fairly new to using PyQt5 but trying. The problem I'm facing is actually getting the EXE in question to run within my applications Frame, Window or QWidget. At the moment I don't need to send or get responses/results to and from the Windows executable, I only need the ability to show it within my application. class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI

Running a Windows executable (calc.exe, etc) inside a PyQt Application

▼魔方 西西 提交于 2021-02-11 06:48:39
问题 I'm trying to run a Windows executable inside my application written in Python using PyQt5. I'm fairly new to using PyQt5 but trying. The problem I'm facing is actually getting the EXE in question to run within my applications Frame, Window or QWidget. At the moment I don't need to send or get responses/results to and from the Windows executable, I only need the ability to show it within my application. class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI

Can you add JButtons inside a JPanel

拟墨画扇 提交于 2021-02-11 06:16:06
问题 I'm making a Battleship game using one board. The picture below shows how the board GUI should look. My current code sets up a board without the 'menu-layer'. (see picture) I tried doing this using Swing GUI designer in Intellij and got the following form (see picture), but can't find a way to insert these buttons inside the panel. Currently, I have got the following code. package BattleshipGUI; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class BoardFrame extends

I need simplest way to draw a line in java in AWT panel

南楼画角 提交于 2021-02-10 23:52:48
问题 I need the simplest way to draw a line between to coordinates. Since this drawing line in my code will be repeated more than 200 times in a loop i need the easiest way. I'm drawing the lines in a AWT panel component. 回答1: If you want to switch to Swing you would use the JPanel and overwrite the paintComponent() method. import java.awt.Graphics; import javax.swing.JPanel; public class PanelWithLine extends JPanel { @Override protected void paintComponent(Graphics g) { super.paintComponent(g);