新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
GTKMM——GTK的C++封裝-創(chuàng)新互聯(lián)
1. Gtkmm學習資源
當前文章:GTKMM——GTK的C++封裝-創(chuàng)新互聯(lián)
當前鏈接:http://www.dlmjj.cn/article/ddidgh.html
- Gnome Projects
https://wiki.gnome.org/Projects
https://wiki.gnome.org/Projects/gtkmm - gtkmm: C++ Interfaces for GTK and GNOME
https://gtkmm.org/en/
https://developer-old.gnome.org/gtkmm-tutorial/stable/sec-gtkmm.html.zh_CN - Programming with gtkmm
https://developer-old.gnome.org/gtkmm-tutorial/ - gtkmm on Microsoft Windows
https://wiki.gnome.org/Projects/gtkmm/MSWindows - gtkmm-documentation(github文檔,有examples)
https://gitlab.gnome.org/GNOME/gtkmm-documentation/-/tree/master/
- 安裝參考網(wǎng)址: https://wiki.gnome.org/Projects/gtkmm/MSWindows
- CB20.03配置和Gtk在CB中的配置過程一樣,首先使用pkg-config查尋gtkmm編譯依賴相關(guān)信息:
# pkg-config --cflags gtkmm-3.0 |xargs -n1
# pkg-config --libs gtkmm-3.0 |xargs -n2
然后,在CB中新建一個基于C++語言的項目,并打開項目的
Build options...
進行以下配置:
1. Other compiler options
2. Linker settings
3. Search directories
#includeint main(int argc, char** argv)
{auto app = Gtk::Application::create(argc, argv);
Gtk::Window window;
window.set_title("Hello,Gtkmm..");
window.set_default_size(400,300);
return app->run(window);
}
#include#include#include#includeclass Buttons : public Gtk::Window
{public:
Buttons();
virtual ~Buttons();
protected:
//Signal handlers:
void on_button_clicked();
//Child widgets:
Gtk::Button m_button;
};
Buttons::Buttons()
{m_button.add_pixlabel("info.xpm", "cool button");
set_title("Pixmap'd buttons!");
set_border_width(10);
set_default_size(280,40);
set_position(Gtk::WIN_POS_CENTER);
m_button.signal_clicked().connect( sigc::mem_fun(*this, &Buttons::on_button_clicked) );
add(m_button);
show_all_children();
}
Buttons::~Buttons(){}
void Buttons::on_button_clicked()
{std::cout<< "The Button is clicked"<< std::endl;
}
int main(int argc, char *argv[])
{auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
Buttons buttons;
//Shows the window and returns when it is closed.
return app->run(buttons);
}
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機房具備T級流量清洗系統(tǒng)配攻擊溯源,準確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級服務(wù)器適合批量采購,新人活動首月15元起,快前往官網(wǎng)查看詳情吧
當前文章:GTKMM——GTK的C++封裝-創(chuàng)新互聯(lián)
當前鏈接:http://www.dlmjj.cn/article/ddidgh.html