GUI带有右键菜单,带有时间显示的
%带有右键菜单的GUI
figure('Menubar','none');
h = uicontextmenu;
uimenu(h,'Label','A');
uimenu(h,'Label','B');
set(gcf,'Uicontextmenu',h); %获得当前时间
datestr(now)
右键菜单

function varargout = GUI17(varargin)
% GUI17 MATLAB code for GUI17.fig
% GUI17, by itself, creates a new GUI17 or raises the existing
% singleton*.
%
% H = GUI17 returns the handle to a new GUI17 or the handle to
% the existing singleton*.
%
% GUI17('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI17.M with the given input arguments.
%
% GUI17('Property','Value',...) creates a new GUI17 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before GUI17_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to GUI17_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help GUI17 % Last Modified by GUIDE v2. -Jan- :: % Begin initialization code - DO NOT EDIT
gui_Singleton = ;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI17_OpeningFcn, ...
'gui_OutputFcn', @GUI17_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{})
gui_State.gui_Callback = str2func(varargin{});
end if nargout
[varargout{:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT % --- Executes just before GUI17 is made visible.
function GUI17_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to GUI17 (see VARARGIN) % Choose default command line output for GUI17
handles.output = hObject; handles.ht = timer;
set(handles.ht, 'ExecutionMode', 'FixedRate');
set(handles.ht, 'Period', );
set(handles.ht, 'TimerFcn', {@dispnow,handles}) start(handles.ht); % Update handles structure
guidata(hObject, handles); % UIWAIT makes GUI17 wait for user response (see UIRESUME)
% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.
function varargout = GUI17_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure
varargout{} = handles.output; function dispnow(hObject , eventdata, handles)
set(handles.disptime, 'String', datestr(now));
带有时间显示

GUI带有右键菜单,带有时间显示的的更多相关文章
- 关于FMX 单击出来右键菜单,并显示在当前下面
关于FMX 单击出来右键菜单,并显示在当前下面 procedure TForm1.btn6MouseDown(Sender: TObject; Button: TMouseButton; Shift ...
- Matlab学习------------带有右键菜单的GUI学习实例
实例步骤: 须要设置UIContextMenu,否则点击右键不显示. 右键点击第一个菜单之后:(在菜单中加入对应的回调函数) function r1_Callback(hObject, eventda ...
- 在windows右键菜单中加入自己的程序 [转载]
原文链接: http://blog.csdn.net/marklr/article/details/4006356 在windows右键菜单中加入自己的程序 标签: windowsattribute ...
- Windows右键菜单设置与应用技巧
http://blog.163.com/lee_honleon/blog/static/555251522008014258896/ 需要修改注册表,挺麻烦的.最好还是把迅雷卸了重装,不会影响什么 ...
- 怎样在Windows资源管理器中添加右键菜单以及修改右键菜单顺序
有时,我们需要在Windows资源管理器的右键菜单中添加一些项,以方便使用某些功能或程序. 比如我的电脑上有一个免安装版的Notepad++,我想在所有文件的右键菜单中添加一项用Notepad++打开 ...
- 【TextBox】重写右键菜单
参考资料 http://bbs.csdn.net/topics/390324356 http://www.cnblogs.com/ycxy/archive/2012/10/09/2716852.htm ...
- (四)Qt之右键菜单
1.右键菜单创建和显示 作为一种交互性强.使用方便的右键菜单在程序中是非常常用的,在Qt中可以轻松的实现. QMenu menu; //添加菜单项,指定图标.名称.响应函数 menu.addActio ...
- 手动添加git到目录右键菜单
1.通过在"运行"中输入'regedit',打开注册表. 2.找到[HKEY_CLASSES_ROOT\Directory\Background]. 3.在[Backgroun ...
- VS2013在右键菜单添加命令插件开发
一.选择Visual Studio Package模板建立插件项目 由于此功能需要在右键菜单上添加命令,所以选择Visual Studio Package模板,根据模板向导步骤插件项目,在Select ...
随机推荐
- nginx做正向代理
#代理服务器设置 server { resolver 8.8.8.8; resolver 114.114.114.114; listen ; access_log /home/lin/proxy.ac ...
- MHA配置参数详解 【转】
mha配置参数详解: 参数名字 是否必须 参数作用域 默认值 示例 hostname Yes Local Only - hostname=mysql_server1, hostname=192.168 ...
- RzCheckTree基本使用
procedure TForm1.Button1Click(Sender: TObject); var i: Integer; begin //循环读取勾选节点代码及内容 //StateIndex 1 ...
- 008-docker-安装-tomcat:8.5.38-jre8
1.搜索镜像 docker search tomcat 2.拉取合适镜像 查询tags:https://hub.docker.com/ docker pull tomcat:8.5.38-jre8 d ...
- 转发(forward)和重定向(redirect)
转发和重定向 参考:http://www.2cto.com/kf/201107/97118.html 以前写的一个注册页面: package com.ifly.bbs.controller; impo ...
- Nginx解析PHP的原理 | CGI、FastCGI及php-fpm的关系
Nginx解析PHP的原理,CGI/FastCGI以及PHP-Fpm的关系. 一.PHP+Nginx应运而生的场景.随着互联网的发展,用户对此接受面广,数据流的增大使得Web端的运行承载压力日益增大, ...
- SQL IN查询优化
实际项目中有如下SQL, 发现效率很低,用时超过1分钟 select TaskID, StartDate = min(UpdateTime), EndDate = max(UpdateTime) fr ...
- 【LeetCode每天一题】Next Permutation(下一个排列)
Implement next permutation, which rearranges numbers into the lexicographically next greater permuta ...
- 超全PHP学习资源整理:入门到进阶系列
PHP是少数几门在语言层面饱受诟病,但在实际开发和应用上却又让人无法撒手的语言之一.就好比路边摊小吃,一遍骂人家不卫生,一遍却又说:真香.所谓接地气,不外如此,大道理不说,PHP光是轮子多.市场占有率 ...
- cocos2d-x C++ iOS工程集成第三方支付宝支付功能
一.在支付宝开放平台下载支付宝SDK(https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.WWgVz8&tr ...