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 ...
随机推荐
- 008-js中的正则表达式
查看地址:http://www.runoob.com/js/js-regexp.html 一.正则表达式概述 正则表达式(英语:Regular Expression,在代码中常简写为regex.reg ...
- WebStrom2018注册码
2RRJMBXW33-eyJsaWNlbnNlSWQiOiIyUlJKTUJYVzMzIiwibGljZW5zZWVOYW1lIjoi5b285bK4IHNvZnR3YXJlMiIsImFzc2lnb ...
- eclipse 假死
由于电脑关机,导致Eclipse非正常关闭,之后启动Eclipse发现一直启动不起来,于是从网上找了一些方法如下: 1.删除文件.snap 到<workspace>\.metadata\. ...
- 什么是AOP面向切面编程
什么是AOP 连接地址:http://blog.csdn.net/moreevan/article/details/11977115/ AOP(Aspect-OrientedProgramming,面 ...
- [django]django查询最佳实战
from django.db.models import Max, Min, Sum, Avg, Count, Q, F Django中的F和Q函数 一.F介绍 作用:操作数据表中的某列值,F()允许 ...
- Py中re.sub学习【转载】
转自:https://www.crifan.com/python_re_sub_detailed_introduction/ //这个网址讲的不错. 1.re.sub的功能 re是regular ex ...
- Http post/get
什么是HTTP? 超文本传输协议(HyperText Transfer Protocol -- HTTP)是一个设计来使客户端和服务器顺利进行通讯的协议. HTTP在客户端和服务器之间以request ...
- 第一弹:超全Python学习资源整理(入门系列)
随着人工智能.大数据的时代到来,学习Python的必要性已经显得不言而喻.我经常逛youtube,发现不仅仅是以编程为职业的程序员,证券交易人员,生物老师,高级秘书......甚至许多自由撰稿人,设计 ...
- [LeetCode] 872. Leaf-Similar Trees_Easy tag: DFS
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form ...
- CentOS6.5安装Elasticsearch5.3.0
1. 首页到官方网站下载最新安装包 https://www.elastic.co/downloads/elasticsearch elasticsearch-5.3.0.tar.gz 2. 将软件包上 ...