Gtkmm

Technology
12 hours ago
8
4
2
Avatar
Author
Albert Flores

gtkmm (někdy také gtk--) je GTK+ pro C++. Je to svobodný software pod licencí GNU Lesser General Public License.

Hello World

//HelloWorldWindow.h #ifndef HELLOWORLDWINDOW_H #define HELLOWORLDWINDOW_H

#include #include

// Derive a new window widget from an existing one. // This window will only contain a button labelled "Hello World" class HelloWorldWindow : public Gtk::Window { public: HelloWorldWindow;

protected: void on_button_clicked; //event handler

Gtk::Button hello_world; };

#endif

//HelloWorldWindow.cc #include #include "HelloWorldWindow.h"

HelloWorldWindow::HelloWorldWindow : hello_world("Hello World") { // Set the title of the window. set_title("Hello World");

// Add the member button to the window, add(hello_world);

// Handle the 'click' event. hello_world.signal_clicked.connect( sigc::mem_fun(*this, &HelloWorldWindow::on_button_clicked));

// Display all the child widgets of the window. show_all_children; }

void HelloWorldWindow::on_button_clicked { std::cout

//main.cc

#include #include "HelloWorldWindow.h"

int main(int argc, char *argv[]) { // Initialization Gtk::Main kit(argc, argv);

// Create a hello world window object HelloWorldWindow example;

// gtkmm main loop Gtk::Main::run(example); return 0; }

Aplikace, které gtkmm používají

Inkscape - vektorový grafický editor * K-3D * Workrave * GParted - správce diskových oddílů * Gobby * Nemiver * Referencer * MySQL * Ardour * Gnote * VMware Workstation a VMware Player - pouze verze pro Linux

5 min read
Share this post:
Like it 8

Leave a Comment

Please, enter your name.
Please, provide a valid email address.
Please, enter your comment.
Enjoy this post? Join Cesko.wiki
Don’t forget to share it
Top