starting class declaration
This commit is contained in:
+18
-3
@@ -5,21 +5,36 @@
|
|||||||
class MyWindow : public Gtk::Window {
|
class MyWindow : public Gtk::Window {
|
||||||
public:
|
public:
|
||||||
MyWindow();
|
MyWindow();
|
||||||
|
virtual ~MyWindow();
|
||||||
|
|
||||||
|
public:
|
||||||
|
Gtk::Button button;
|
||||||
|
void startCapture();
|
||||||
};
|
};
|
||||||
|
|
||||||
MyWindow::MyWindow() {
|
MyWindow::MyWindow() {
|
||||||
set_title("Basic application");
|
set_title("Basic application");
|
||||||
|
|
||||||
Gtk::Button button("Hello World");
|
Gtk::Button button("start capture");
|
||||||
button.signal_clicked().connect([] { std::cout << "Hello World\n"; });
|
|
||||||
button.set_label("Hello World");
|
button.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::startCapture));
|
||||||
|
|
||||||
set_default_size(800, 450);
|
set_default_size(800, 450);
|
||||||
|
|
||||||
set_child(button);
|
set_child(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyWindow::~MyWindow() {}
|
||||||
|
|
||||||
|
void MyWindow::startCapture() {
|
||||||
|
std::cout << "start capture" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
auto app = Gtk::Application::create("org.gtkmm.examples.base");
|
auto app = Gtk::Application::create("org.gtkmm.examples.base");
|
||||||
|
|
||||||
return app->make_window_and_run<MyWindow>(argc, argv);
|
return app->make_window_and_run<MyWindow>(argc, argv);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user