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 ...
随机推荐
- centos6.8上yum安装zabbix3.2
centos6.8上yum安装zabbix3.2 zabbix3.2安装文档:https://www.zabbix.com/documentation/3.2/manual/installation/ ...
- TCP、UDP和HTTP详解
http:是用于www浏览的一个协议.tcp:是机器之间建立连接用的到的一个协议. 1.TCP/IP是个协议组,可分为三个层次:网络层.传输层和应用层.在网络层有IP协议.ICMP协议.ARP协议.R ...
- 配置Tomcat启用Https安全协议的访问
1.首先使用keytool工具生成证书文件名为cnkey,然后拷贝此证书即文件到tomcat安装目录conf下(放到哪里都行,主要在下面配置中指明路径就好了.这里我就放这了conf) 2.配置serv ...
- 开发中清除css加载的缓存使用
- js模拟链表
链表: 每个元素,都有一个指针,指向下一个元素 //链表 function LinkedList(){ var head = null; length = 0; this.append = funct ...
- git安装和使用(二)
一.git安装 1.目的 通过git管理github托管项目代码 2.下载安装 Git - Downloading Packagewww.git-scm.com 点击桌面,右击鼠标,出现两个git单 ...
- xmlns:dubbo 路径错误
It goes normal when change <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
- win10升级后,无法ping通vmware的centos解决方法
win10是lenovo thinkpad460上面的,是正版的.无法做设置,不让其自动升级.10月8日节后第一天上班,电脑要求更新,我就点更新. 结果就发现无法ping通vmware中的centos ...
- C# 图片 旋转和翻转 RotateFlip
1.Rotate90FlipX2.Rotate90FliY3.Rotate90FlipXY4.Rotate90FlipNone以上面四个为例:1是指定后接水平翻转的90度顺时针旋转,2是指定后接垂直翻 ...
- MongoDB--$project和$push的区别
正文开始前,首先需要表名几条定义: 聚合(aggregate)是基于数据处理的聚合管道,每个文档通过一个由多个阶段(stage)组成的管道,可以对每个阶段的管道进行分组.过滤等功能,然后经过一系列的处 ...