From 9f627fed2f902cda1436b5e934dd2a2309412bd3 Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 23 Jul 2023 07:20:21 -0700 Subject: [PATCH] separating out the file for header --- src/main.cpp | 20 ++++---------------- src/main.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 src/main.h diff --git a/src/main.cpp b/src/main.cpp index ce48296..2849d4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,22 +2,15 @@ #include #include -class MyWindow : public Gtk::Window { -public: - MyWindow(); - virtual ~MyWindow(); - -public: - Gtk::Button button; - void startCapture(); -}; +#include "main.h" MyWindow::MyWindow() { set_title("Basic application"); Gtk::Button button("start capture"); - button.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::startCapture)); + button.signal_clicked().connect( + sigc::mem_fun(*this, &MyWindow::startCapture)); set_default_size(800, 450); @@ -26,12 +19,7 @@ MyWindow::MyWindow() { MyWindow::~MyWindow() {} -void MyWindow::startCapture() { - std::cout << "start capture" << std::endl; - - -} - +void MyWindow::startCapture() { std::cout << "start capture" << std::endl; } int main(int argc, char **argv) { auto app = Gtk::Application::create("org.gtkmm.examples.base"); diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..a024285 --- /dev/null +++ b/src/main.h @@ -0,0 +1,11 @@ +#include + +class MyWindow : public Gtk::Window { +public: + MyWindow(); + virtual ~MyWindow(); + +public: + Gtk::Button button; + void startCapture(); +};