当前位置: 首页 > news >正文

环保部网站官网建设项目审批河南省建协网官方网站

环保部网站官网建设项目审批,河南省建协网官方网站,机械厂网站建设,收录排名好的发帖网站文章目录 前言来看一个从字符串中生成UI的例子 前言 glade生成的xml格式不被gtkmm4支持, 需要作修改 来看一个从字符串中生成UI的例子 #include <gtkmm/application.h> #include <gtkmm.h> #include <iostream> using namespace std;class ExampleWindow :…

文章目录

  • 前言
  • 来看一个从字符串中生成UI的例子

前言

  • glade生成的xml格式不被gtkmm4支持, 需要作修改

来看一个从字符串中生成UI的例子

  • #include <gtkmm/application.h>
    #include <gtkmm.h>
    #include <iostream>
    using namespace std;class ExampleWindow : public Gtk::Window
    {
    public:ExampleWindow();virtual ~ExampleWindow() {};void on_action_file_new(){cout << "New" << endl;};void on_action_file_open() {};void on_action_file_quit() {};Gtk::Box m_Box;
    };
    ExampleWindow::ExampleWindow()
    {auto m_refBuilder = Gtk::Builder::create();Glib::ustring ui_info ="<interface>""  <menu id='menubar'>""    <submenu>""      <attribute name='label' translatable='yes'>_File</attribute>""      <section>""        <item>""          <attribute name='label' translatable='yes'>_New</attribute>""          <attribute name='action'>example.new</attribute>""        </item>""      </section>""      <section>""        <item>""          <attribute name='label' translatable='yes'>_Quit</attribute>""          <attribute name='action'>example.quit</attribute>""        </item>""      </section>""    </submenu>""    <submenu>""      <attribute name='label' translatable='yes'>_Edit</attribute>""      <item>""        <attribute name='label' translatable='yes'>_Copy</attribute>""        <attribute name='action'>example.copy</attribute>""      </item>""      <item>""        <attribute name='label' translatable='yes'>_Paste</attribute>""        <attribute name='action'>example.paste</attribute>""      </item>""    </submenu>""  </menu>""</interface>";//绑定行动的对应动作 实际绑定auto m_refActionGroup = Gio::SimpleActionGroup::create();m_refActionGroup->add_action("new", sigc::mem_fun(*this, &ExampleWindow::on_action_file_new));m_refActionGroup->add_action("open", sigc::mem_fun(*this, &ExampleWindow::on_action_file_open));m_refActionGroup->add_action("quit", sigc::mem_fun(*this, &ExampleWindow::on_action_file_quit));insert_action_group("example", m_refActionGroup);//行动组example 实体诞生m_refBuilder->add_from_string(ui_info);//m_refBuilder->add_from_file("K:\\CPlusPlus\\cgcc\\Xml_UI.xml");auto gmenu = m_refBuilder->get_object<Gio::Menu>("menubar");auto pMenuBar = Gtk::make_managed<Gtk::PopoverMenuBar>(gmenu);m_Box.append(*pMenuBar);set_child(m_Box);pMenuBar->set_visible(true);m_Box.set_visible(true);
    }
    int main(int argc, char* argv[])
    {auto app = Gtk::Application::create("org.gtkmm.example");//app快捷键 键位设置对应行动 预先设置app->set_accel_for_action("example.new", "<Primary>n");//表示Ctrl+Napp->set_accel_for_action("example.quit", "<Primary>q");//表示Ctrl+Qapp->set_accel_for_action("example.copy", "<Primary>c");//表示Ctrl+Capp->set_accel_for_action("example.paste", "<Primary>v");//表示Ctrl+V//Shows the window and returns when it is closed.return app->make_window_and_run<ExampleWindow>(argc, argv);
    }
    
    可以把那些字符串放入一个xml文件
    image
    然后
    m_refBuilder->add_from_file(“K:\CPlusPlus\cgcc\Xml_UI.xml”);
    代替上面的add_from_string.
http://www.yayakq.cn/news/759247/

相关文章:

  • 网站开发谢辞4444k面访问升最新网站
  • 石家庄专业网站制英文seo
  • 乐山建网站定制职业装
  • 制作企业网站价格网站后台管理系统开发
  • 小广告网站如何推广短视频
  • 建立购物网站的目的如何去建设一个企业网站
  • 企业网站seo外包 s手机制作合同软件
  • 高清图片素材网站免费网站开发公司流程
  • 唐山网站开发山东德州最新消息今天
  • 英文建站一个企业网站建设需要多长时间
  • 网站建设费应该怎样入账wordpress百度xml地图
  • 网页设计 传统网站小程序多用户商城源码
  • 建筑企业网站模板免费下载手机门户网站源码
  • 网站样式工作简历模板范文
  • 团购网站建设流程广告在线设计制作
  • 北京 设计网站浦东新区苏州网站建设
  • 网站的二维码怎么做的母婴网站源码
  • shopify建站费用wordpress判断用户权限
  • 苏华建设集团有限公司网站山西营销网站建设联系方式
  • 视频网站会员系统怎么做周口网站推广
  • 如何查网站处罚过网站彩票网站开发
  • HTML建网站百度下载安装
  • php网站开发数据列表排重石家庄免费专业做网站
  • 做网站空间不给账号密码企业app定制开发公司
  • 虚拟主机搭建网站外贸网络营销的优势
  • 常州网站建站公司网站建设服务采购方案模板
  • 烟台网站建设seo网络运维实习报告
  • 网站核验点查询郑州专业做网站公司
  • 那个网站做国外售货大连零基础网站建设教学服务
  • 建设银行网站国外网站做acm题目比较好