6 changed files with 114 additions and 84 deletions
@ -1,9 +1,14 @@ |
|||||||
#include "juci.h" |
#include "juci.h" |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) { |
int main(int argc, char *argv[]) { |
||||||
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create( |
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create( |
||||||
argc, |
argc, |
||||||
argv, |
argv, |
||||||
"no.sout.juci"); |
"no.sout.juci"); |
||||||
|
// app->set_flags(Gio::APPLICATION_NON_UNIQUE);
|
||||||
|
|
||||||
Window window; |
Window window; |
||||||
return app->run(window); |
return app->run(window); |
||||||
} |
} |
||||||
|
|||||||
@ -1,18 +1,26 @@ |
|||||||
#include "juci.h" |
#include "juci.h" |
||||||
|
Window::Window() : |
||||||
Window::Window() : |
window_box_(Gtk::ORIENTATION_HORIZONTAL), |
||||||
window_box_(Gtk::ORIENTATION_HORIZONTAL), |
menu_(keybindings_) { |
||||||
menu_(keybindings_) { |
set_title("juCi++"); |
||||||
set_title("example juCi++"); |
set_default_size(600, 600); |
||||||
set_default_size(600, 600); |
// window_box_.add(*source_.sourceview());
|
||||||
// window_box_.add(*source_.sourceview());
|
add(window_box_); |
||||||
add(window_box_); |
keybindings_.action_group()->add(Gtk::Action::create("FileQuit", |
||||||
add_accel_group(keybindings_.ui_manager()->get_accel_group()); |
Gtk::Stock::QUIT), |
||||||
window_box_.pack_start(menu_.view()); |
[this]() { |
||||||
show_all_children(); |
OnSystemQuit(); |
||||||
|
}); |
||||||
} |
add_accel_group(keybindings_.ui_manager()->get_accel_group()); |
||||||
|
//Add views under here
|
||||||
std::shared_ptr<Source::Controller> Window::source() { |
window_box_.pack_start(menu_.view()); |
||||||
return std::shared_ptr<Source::Controller>(&source_); |
show_all_children(); |
||||||
} |
} |
||||||
|
|
||||||
|
std::shared_ptr<Source::Controller> Window::source() { |
||||||
|
return std::shared_ptr<Source::Controller>(&source_); |
||||||
|
} |
||||||
|
|
||||||
|
void Window::OnSystemQuit() { |
||||||
|
hide(); |
||||||
|
} |
||||||
Loading…
Reference in new issue