libsigc 是如何包含在 gtkmm 项目中的
How is libsigc included in gtkmm projects?
在gtkmm教程hello world示例中,libsigc++
库用于helloword.cc
文件:
#include "helloworld.h"
#include <iostream>
HelloWorld::HelloWorld()
: m_button("Hello World") // creates a new button with label "Hello World".
{
// Sets the border width of the window.
set_border_width(10);
// When the button receives the "clicked" signal, it will call the
// on_button_clicked() method defined below.
m_button.signal_clicked().connect(sigc::mem_fun(*this,
&HelloWorld::on_button_clicked));
// This packs the button into the Window (a container).
add(m_button);
// The final step is to display this newly created widget...
m_button.show();
}
但是,libsigc++
永远不会包含在此文件中,但这仍然可以正常工作。sigc
命名空间从何而来?
编辑: helloworld.h
:
#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
#define GTKMM_EXAMPLE_HELLOWORLD_H
#include <gtkmm/button.h>
#include <gtkmm/window.h>
class HelloWorld : public Gtk::Window
{
public:
HelloWorld();
virtual ~HelloWorld();
protected:
//Signal handlers:
void on_button_clicked();
//Member widgets:
Gtk::Button m_button;
};
#endif // GTKMM_EXAMPLE_HELLOWORLD_H
查看 "gtkmm/window.h" 的内容
http://fossies.org/unix/privat/gtkmm-3.6.0.tar.gz/dox/gtk_2gtkmm_2window_8h.html
它包括"SIGC++.h"
您可以在main.h
中找到包含
http://git.gnome.org/browse/gtkmm/tree/gtk/src/main.hg#n22
包含在gtkmm.h
http://git.gnome.org/browse/gtkmm/tree/gtk/gtkmm.h#n181
相关文章:
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 无法在 CLion 中构建 C++ 项目
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 欧拉项目#8答案是大以获得有效答案
- 从链接列表c++中删除一个项目
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 既然存在危险,为什么项目要使用-I include开关
- cmake在我的项目中所需的所有静态库都不成功
- QT通过C++添加映射QML项目
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在linux上调试巨大的C++项目
- 在其他文件中创建类时在 c++ 项目中不起作用
- Windows 10-使用gtkmm-3.0库和g++[包括再现]的分段故障
- 使外部项目可用于find_package CMake
- 在子目录中使用target_sources()命令时用于单元测试(qtest)的项目结构
- 如何配置 Clion 来编译 gtkmm 项目
- libsigc 是如何包含在 gtkmm 项目中的
- 如何使用gtkmm在TreeView中使单个项目加粗