참고페이지 ->
http://gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-libglademm.html
실행화면 ->

Glade3 실행 ->

생성된 Glade 파일 ->
사용된 예제 코드 ->
glade파일과 코드를 함께 보면 그다지 어렵지는 않다.
개념적인 부분은 이미 번역되어있는 GTK+ 문서를 활용하자.
http://wiki.kldp.org/wiki.php/LinuxdocSgml/GtkTutorial-TRANS 같은 것들.
http://gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-libglademm.html
실행화면 ->
Glade3 실행 ->
생성된 Glade 파일 ->
사용된 예제 코드 ->
| 1 #include "stdafx.h" 2 3 #include <gtkmm.h> 4 #include <libglademm.h> 5 #include <iostream> 6 #include <windows.h> 7 #include <direct.h> 8 9 10 Gtk::Dialog* pDialog = 0; 11 Glib::ustring g_ustrFilePath; 12 13 void on_button_clicked() 14 { 15 if(pDialog) 16 pDialog->hide(); //hide() will cause main::run() to end. 17 } 18 19 int main (int argc, char *argv[]) 20 { 21 Gtk::Main kit(argc, argv); 22 23 // 현재 실행파일의 경로를 구함. 24 { 25 char buf[256] = {0,}; 26 strncpy(buf, argv[0], strlen(argv[0])-strlen(strrchr(argv[0],'\\'))+1); 27 g_ustrFilePath=buf; 28 } 29 30 //Load the Glade file and instiate its widgets: 31 Glib::RefPtr<Gnome::Glade::Xml> refXml; 32 try 33 { 34 refXml = Gnome::Glade::Xml::create(g_ustrFilePath+"test.glade"); 35 } 36 catch(const Gnome::Glade::XmlError& ex) 37 { 38 std::cerr << ex.what() << std::endl; 39 return 1; 40 } 41 //Get the Glade-instantiated Dialog: 42 refXml->get_widget("DialogBasic", pDialog); 43 if(pDialog) 44 { 45 //Get the Glade-instantiated Button, and connect a signal handler: 46 Gtk::Button* pButton = 0; 47 refXml->get_widget("Exit", pButton); 48 if(pButton) 49 { 50 pButton->signal_clicked().connect( sigc::ptr_fun(on_button_clicked) ); 51 } 52 kit.run(*pDialog); 53 } 54 return 0; 55 } 56 57 |
glade파일과 코드를 함께 보면 그다지 어렵지는 않다.
개념적인 부분은 이미 번역되어있는 GTK+ 문서를 활용하자.
http://wiki.kldp.org/wiki.php/LinuxdocSgml/GtkTutorial-TRANS 같은 것들.
TAG gtkmm


test.glade
이올린에 북마크하기
이올린에 추천하기
comment
댓글.......ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ
댓글에 성의좀..ㅠㅜ
성의
우분투에서 해 보면 재밌겠당;;
오사카 들렀다감~~