In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use scripts to generate GUI directly, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Some time ago, I changed my habit of using GUIDE to do GUI. I remember I said before that using GUIDE to do GUI convenience point (at that time I think you don't have to calculate the value of the Position attribute with GUIDE), but later, I think this GUIDE will generate some code that you do not want to see (such as the beginning paragraph, now it looks very uncomfortable), and the things made by GUIDE are relatively large, without the fig file can not be run (when you lost the fig file is very uncomfortable).
So a while ago I decided to take some time to change the habit of using GUIDE as an interface. In fact, the m file corresponding to GUIDE is still very similar, the following points are a little different.
Without the big chunk that started in the m file generated by GUIDE, it's obvious. What I want to say is mainly the callback function:
1. The callback function template generated by GUIDE is fixed with three parameters: hObject,eventdata,handles, which can be replaced with ~ when it is not needed.
two。 When you customize the callback function, the callback function has two necessary parameters hObject and eventdata, the meaning of these two parameters is the same as above, these two parameters can be other names. In addition, the custom callback function can pass parameters to the callback function (you don't have to pass as much as you want if you use setappdata and getappdata). As for the rules for passing parameters, please see the hyperlink article above.
Directly generating GUI with m file mainly involves two built-in functions, figure and uicontrol, which are used to set up the interface and controls respectively, and generate different controls through the Style property of uicontrol.
Emm, in the next series of articles, I'm going to talk about generating GUI directly from m files. It is recommended that you also use this way to generate GUI in the future.
In addition, I am now learning Qt, and found that there are many places and MATLAB do GUI is very similar. I plan to write some after a period of time: a picture and text done with Qt and MATLAB in the same interface, so as to compare and learn. I was talking about learning labview and then comparing the interface with MATLAB. Later, my brother told me that there were other brothers doing it, so I didn't learn it. )
After reading the above, do you have any further understanding of how to generate GUI directly from a script? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.