%带有右键菜单的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带有右键菜单,带有时间显示的的更多相关文章

  1. 关于FMX 单击出来右键菜单,并显示在当前下面

    关于FMX  单击出来右键菜单,并显示在当前下面 procedure TForm1.btn6MouseDown(Sender: TObject; Button: TMouseButton; Shift ...

  2. Matlab学习------------带有右键菜单的GUI学习实例

    实例步骤: 须要设置UIContextMenu,否则点击右键不显示. 右键点击第一个菜单之后:(在菜单中加入对应的回调函数) function r1_Callback(hObject, eventda ...

  3. 在windows右键菜单中加入自己的程序 [转载]

    原文链接: http://blog.csdn.net/marklr/article/details/4006356  在windows右键菜单中加入自己的程序 标签: windowsattribute ...

  4. Windows右键菜单设置与应用技巧

    http://blog.163.com/lee_honleon/blog/static/555251522008014258896/   需要修改注册表,挺麻烦的.最好还是把迅雷卸了重装,不会影响什么 ...

  5. 怎样在Windows资源管理器中添加右键菜单以及修改右键菜单顺序

    有时,我们需要在Windows资源管理器的右键菜单中添加一些项,以方便使用某些功能或程序. 比如我的电脑上有一个免安装版的Notepad++,我想在所有文件的右键菜单中添加一项用Notepad++打开 ...

  6. 【TextBox】重写右键菜单

    参考资料 http://bbs.csdn.net/topics/390324356 http://www.cnblogs.com/ycxy/archive/2012/10/09/2716852.htm ...

  7. (四)Qt之右键菜单

    1.右键菜单创建和显示 作为一种交互性强.使用方便的右键菜单在程序中是非常常用的,在Qt中可以轻松的实现. QMenu menu; //添加菜单项,指定图标.名称.响应函数 menu.addActio ...

  8. 手动添加git到目录右键菜单

      1.通过在"运行"中输入'regedit',打开注册表. 2.找到[HKEY_CLASSES_ROOT\Directory\Background]. 3.在[Backgroun ...

  9. VS2013在右键菜单添加命令插件开发

    一.选择Visual Studio Package模板建立插件项目 由于此功能需要在右键菜单上添加命令,所以选择Visual Studio Package模板,根据模板向导步骤插件项目,在Select ...

随机推荐

  1. 20180409 Code First

    many people use DB First,Today I see Code First.  这部分,百度上面有更多详细的资料,虽然不明白Migrations内部的机制,但是还是可以记录一下 打 ...

  2. 20170728 Celery项目 后台处理SQL SERVER的一个异常

    -- 1. 感觉是访问DB 失败了,失败原因不明确 -- 2. 考虑解决问题的解决办法,后台记录异常,并重新发送任务. 具体如何来实现

  3. 008-spring cache-缓存实现-03-springboot redis实现

    1.window下redis安装 https://www.cnblogs.com/bjlhx/p/7429811.html 2.pom <!-- 缓存 --> <dependency ...

  4. select默认选择后台转过来的option选项

    <select> <option value="#" >--请选择--</option> <option value="1&qu ...

  5. confd动态生成配置文件

    下载安装confd $ mkdir -p $GOPATH/src/github.com/kelseyhightower $ git clone https://github.com/kelseyhig ...

  6. fullpage插件在移动端弹出键盘页面特殊处理

    fullpage插件大家都很熟悉 jquery一款全屏上下滑动的插件. 最近做公司一个活动移动端使用fullpage插件填写input的时候遇见一个问题,手机自带的键盘弹出的时候会把页面顶出去,页面错 ...

  7. Boost学习-Linuxidc上的很好的学习资料

    来自 http://www.linuxidc.com/Linux/2011-07/39215.htm,拷贝第一页如下 Boost学习系列 简介及基本用法 [日期:2011-07-25] 来源:Linu ...

  8. AM自动化测试平台

    AM自动化测试平台介绍: 最初目标:是为了做接口自动化测试,该平台,集成了,用例管理,测试执行,测试套件(主要为了应对,对场景业务流程有需要的),测试报告展示. 后期目标:适当增加,其它测试工具进行集 ...

  9. 懒汉处理dapper字段名与属性名的映射方式

    你还以为走路是世上最简单的事情呢?只不过是把一只脚放到另一只脚前面.但我一直很惊讶这些原本是本能的事情实际上做起来有多困难.而吃,吃也是一样的,有些人吃起东西来可困难了.说话也是,还有爱.这些东西都可 ...

  10. MyBatis基础入门《一》环境搭建

    MyBatis基础入门<一>环境搭建 参考资料链接:http://www.mybatis.org/mybatis-3/ 使用maven构建项目,STS开发工具,jdk1.8 项目结构: m ...