user-interface

MATLAB slider step behavior

徘徊边缘 提交于 2021-02-18 05:07:12
问题 I have a created a slider widget using GUIDE in MATLAB 2012a. I want it to control an axis that displays images inwhich the slider steps through a sequence of them. I have set the slider's properties for Min, Max, and SliderStep in one part of the m-file. sliderMin = 1; sliderMax = size(result); % this is variable sliderStep = [1, 1]; % major and minor steps of 1 set(handles.slider, 'Min', sliderMin); set(handles.slider, 'Max', sliderMax); set(handles.slider, 'SliderStep', sliderStep); set

How to add placeholder text to TextEditor in SwiftUI?

半世苍凉 提交于 2021-02-18 05:07:09
问题 When using SwiftUI's new TextEditor, you can modify its content directly using a @State. However, I haven't see a way to add a placeholder text to it. Is it doable right now? I added an example that Apple used in their own translator app. Which appears to be a multiple lines text editor view that supports a placeholder text. 回答1: It is not possible out of the box but you can achieve this effect with ZStack or the .overla y property. What you should do is check the property holding your state.

JPanel not changing on JFrame

徘徊边缘 提交于 2021-02-17 05:43:25
问题 The idea is to have one "global" JFrame which I can then add/remove JPanels as needed to make a smooth flowing application. Currently, when I try changing from the first JPanel to the second, the second won't display. My code is below: Handler (class to run the app): package com.example.Startup; import com.example.Global.Global_Frame; public class Handler { public Handler() { gf = new Global_Frame(); gf.getAccNum(); gf.setVisible(true); } public static void main(String[] args) { new Handler()

JPanel not changing on JFrame

痴心易碎 提交于 2021-02-17 05:41:02
问题 The idea is to have one "global" JFrame which I can then add/remove JPanels as needed to make a smooth flowing application. Currently, when I try changing from the first JPanel to the second, the second won't display. My code is below: Handler (class to run the app): package com.example.Startup; import com.example.Global.Global_Frame; public class Handler { public Handler() { gf = new Global_Frame(); gf.getAccNum(); gf.setVisible(true); } public static void main(String[] args) { new Handler()

Semi-Interactive Pandas Dataframe in a GUI

馋奶兔 提交于 2021-02-17 03:43:52
问题 There are a number of excellent answers to this question GUIs for displaying dataframes, but what I'm looking to do is a bit more advanced. I'd like to display a dataframe, but have a couple of the columns be interactive where the user can manually overwrite values (and the rest be static). It would be useful to have "total" rows that change with the overwritten values and eventually have some interactive buttons around the dataframe for loading and clearing data. QTPandas looks promising,

Java Swing GUI updating/changing from method - freezing in loop

梦想与她 提交于 2021-02-16 21:19:09
问题 basically, I have this code which was initially working with console i/o now I have to connect it to UI . It may be completely wrong, I've tried multiple things although it still ends up with freezing the GUI. I've tried to redirect console I/O to GUI scrollpane, but the GUI freezes anyway. Probably it has to do something with threads, but I have limited knowledge on it so I need the deeper explanation how to implement it in this current situation. This is the button on GUI class containing

Display console results to a PyQt5 text box [duplicate]

老子叫甜甜 提交于 2021-02-16 15:41:05
问题 This question already has answers here : Redirecting stdout from a secondary thread (multithreading with a function instead of class?) (1 answer) How to redirect Python script output to PyQT5 GUI Console, without any buttons clicks? (2 answers) Print out python console output to Qtextedit (1 answer) Closed 7 months ago . I am trying to create a graphical interface where my results of certain processes of my program are shown on the screen to a text box, to view them from there. For this I

How to set cursor shape to '>' in a QTextEdit?

天涯浪子 提交于 2021-02-16 14:30:27
问题 I am trying to mimic a command-line client. I wish to set the cursor shape to '>', to show messages to user. I don't see that shape in the options provided by QCursor. Is there a way to set custom shapes to widget cursors? 回答1: You need to set the QTextEdit's viewport's cursor: http://doc.qt.nokia.com/stable/qtextedit.html "The shape of the mouse cursor on a QTextEdit is Qt::IBeamCursor by default. It can be changed through the viewport()'s cursor property." e.g. To hide the cursor completely

making multiple menu's in tkinter

旧城冷巷雨未停 提交于 2021-02-11 18:11:18
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar

making multiple menu's in tkinter

天大地大妈咪最大 提交于 2021-02-11 18:08:23
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar