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