Browse Source

Merge branch 'master' of bitbucket.org:cppit/juci

master
tedjk 11 years ago
parent
commit
8be6c06353
  1. 31
      juci/directories.cc
  2. 32
      juci/notebook.cc
  3. 3
      juci/source.cc
  4. 56
      juci/terminal.cc
  5. 6
      juci/terminal.h
  6. 113
      juci/window.cc
  7. 3
      juci/window.h

31
juci/directories.cc

@ -96,21 +96,38 @@ int Directories::Controller::count(const std::string path) {
while (std::getline(ifs, line)) { while (std::getline(ifs, line)) {
if (line.find(command_name+"(", 0) != std::string::npos if (line.find(command_name+"(", 0) != std::string::npos
|| line.find(command_name+" (", 0) != std::string::npos ) { || line.find(command_name+" (", 0) != std::string::npos ) {
size_t variable_start = line.find("{", 0); size_t variable_start = line.find("{", 0);
size_t variable_end = line.find("}", variable_start); size_t variable_end = line.find("}", variable_start);
project_name_var = line.substr(variable_start+1, project_name_var = line.substr(variable_start+1,
(variable_end)-variable_start-1); (variable_end)-variable_start-1);
boost::algorithm::trim(project_name_var); boost::algorithm::trim(project_name_var);
if (variable_start == std::string::npos) { // not a variable if (variable_start == std::string::npos) { // not a variabel
variable_start = line.find("(", 0); variable_start = line.find("(", 0);
variable_end = line.find(")", variable_start);
INFO("Wasn't a variable, returning value"); variable_end = line.find(' ', variable_start);
if(variable_end != std::string::npos){
return line.substr(variable_start+1,
(variable_end)-variable_start-1);
}
variable_end = line.find("#", variable_start);
if(variable_end != std::string::npos){
return line.substr(variable_start+1,
(variable_end)-variable_start-1);
}
variable_end = line.find(")", variable_start);
return line.substr(variable_start+1, return line.substr(variable_start+1,
(variable_end)-variable_start-1); (variable_end)-variable_start-1);
if (variable_start == std::string::npos) { // not a variable
variable_start = line.find("(", 0);
variable_end = line.find(")", variable_start);
INFO("Wasn't a variable, returning value");
return line.substr(variable_start+1,
(variable_end)-variable_start-1);
} }
break; break;
} }
} }
}
std::ifstream ifs2(itr->path().string()); std::ifstream ifs2(itr->path().string());
while (std::getline(ifs2, line)) { while (std::getline(ifs2, line)) {
if (line.find("set(", 0) != std::string::npos if (line.find("set(", 0) != std::string::npos

32
juci/notebook.cc

@ -1,5 +1,6 @@
#include "notebook.h"
#include <fstream> #include <fstream>
#include "notebook.h"
#include "logging.h"
Notebook::Model::Model() { Notebook::Model::Model() {
cc_extension_ = ".cc"; cc_extension_ = ".cc";
@ -24,11 +25,13 @@ Notebook::Controller::Controller(Gtk::Window* window, Keybindings::Controller& k
ispopup = false; ispopup = false;
view().pack1(directories_.widget(), true, true); view().pack1(directories_.widget(), true, true);
CreateKeybindings(keybindings); CreateKeybindings(keybindings);
INFO("Notebook Controller Sucsess");
} // Constructor } // Constructor
void Notebook::Controller::CreateKeybindings(Keybindings::Controller void Notebook::Controller::CreateKeybindings(Keybindings::Controller
&keybindings) { &keybindings) {
INFO("Notebook create signal handlers");
directories().m_TreeView.signal_row_activated() directories().m_TreeView.signal_row_activated()
.connect(sigc::mem_fun(*this, .connect(sigc::mem_fun(*this,
&Notebook::Controller::OnDirectoryNavigation)); &Notebook::Controller::OnDirectoryNavigation));
@ -138,6 +141,7 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller
[this]() { [this]() {
Search(false); Search(false);
}); });
INFO("Notebook signal handlers sucsess");
} }
bool Notebook::Controller:: OnMouseRelease(GdkEventButton* button) { bool Notebook::Controller:: OnMouseRelease(GdkEventButton* button) {
@ -153,6 +157,7 @@ bool Notebook::Controller::OnKeyRelease(GdkEventKey* key) {
} }
bool Notebook::Controller::GeneratePopup(int key_id) { bool Notebook::Controller::GeneratePopup(int key_id) {
INFO("Notebook genereate popup, getting iters");
// Get function to fill popup with suggests item vector under is for testing // Get function to fill popup with suggests item vector under is for testing
Gtk::TextIter beg = CurrentTextView().get_buffer()->get_insert()->get_iter(); Gtk::TextIter beg = CurrentTextView().get_buffer()->get_insert()->get_iter();
Gtk::TextIter end = CurrentTextView().get_buffer()->get_insert()->get_iter(); Gtk::TextIter end = CurrentTextView().get_buffer()->get_insert()->get_iter();
@ -165,6 +170,7 @@ bool Notebook::Controller::GeneratePopup(int key_id) {
end.backward_search("\"", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line) end.backward_search("\"", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line)
|| ||
end.backward_search("//", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line); end.backward_search("//", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line);
INFO("Notebook genereate popup, checking key_id");
if (illegal_chars) { if (illegal_chars) {
return false; return false;
} }
@ -187,6 +193,7 @@ bool Notebook::Controller::GeneratePopup(int key_id) {
} else { } else {
return false; return false;
} }
INFO("Notebook genereate popup, getting autocompletions");
std::vector<Source::AutoCompleteData> acdata; std::vector<Source::AutoCompleteData> acdata;
text_vec_.at(CurrentPage())-> text_vec_.at(CurrentPage())->
GetAutoCompleteSuggestions(beg.get_line()+1, GetAutoCompleteSuggestions(beg.get_line()+1,
@ -229,16 +236,19 @@ bool Notebook::Controller::GeneratePopup(int key_id) {
popup_.get_vbox()->pack_start(popup_scroll_); popup_.get_vbox()->pack_start(popup_scroll_);
popup_.set_transient_for(*window_); popup_.set_transient_for(*window_);
popup_.show_all(); popup_.show_all();
INFO("Notebook genereate popup, moving popup");
int popup_x = popup_.get_width(); int popup_x = popup_.get_width();
int popup_y = items.size() * 20; int popup_y = items.size() * 20;
PopupSetSize(popup_scroll_, popup_x, popup_y); PopupSetSize(popup_scroll_, popup_x, popup_y);
int x, y; int x, y;
FindPopupPosition(CurrentTextView(), popup_x, popup_y, x, y); FindPopupPosition(CurrentTextView(), popup_x, popup_y, x, y);
popup_.move(x, y+15); popup_.move(x, y+15);
INFO("Notebook genereate popup, create handler");
PopupSelectHandler(popup_, listview_, &items); PopupSelectHandler(popup_, listview_, &items);
ispopup = true; ispopup = true;
INFO("Notebook genereate popup, run popup");
popup_.run(); popup_.run();
INFO("Notebook genereate popup, hide popup");
popup_.hide(); popup_.hide();
ispopup = false; ispopup = false;
return true; return true;
@ -261,6 +271,7 @@ bool Notebook::Controller::ScrollEventCallback(GdkEventScroll* scroll_event) {
return true; return true;
} }
Notebook::Controller::~Controller() { Notebook::Controller::~Controller() {
INFO("Notebook destructor");
for (auto &i : text_vec_) delete i; for (auto &i : text_vec_) delete i;
for (auto &i : linenumbers_vec_) delete i; for (auto &i : linenumbers_vec_) delete i;
for (auto &i : editor_vec_) delete i; for (auto &i : editor_vec_) delete i;
@ -276,6 +287,7 @@ Gtk::Box& Notebook::Controller::entry_view() {
} }
void Notebook::Controller::OnNewPage(std::string name) { void Notebook::Controller::OnNewPage(std::string name) {
INFO("Notebook Generate new page");
OnCreatePage(); OnCreatePage();
text_vec_.back()->OnNewEmptyFile(); text_vec_.back()->OnNewEmptyFile();
Notebook().append_page(*editor_vec_.back(), name); Notebook().append_page(*editor_vec_.back(), name);
@ -294,6 +306,7 @@ MapBuffers(std::map<std::string, std::string> *buffers) {
} }
void Notebook::Controller::OnOpenFile(std::string path) { void Notebook::Controller::OnOpenFile(std::string path) {
INFO("Notebook open file");
OnCreatePage(); OnCreatePage();
text_vec_.back()->OnOpenFile(path); text_vec_.back()->OnOpenFile(path);
text_vec_.back()->set_is_saved(true); text_vec_.back()->set_is_saved(true);
@ -309,6 +322,7 @@ void Notebook::Controller::OnOpenFile(std::string path) {
} }
void Notebook::Controller::OnCreatePage() { void Notebook::Controller::OnCreatePage() {
INFO("Notebook create page");
text_vec_.push_back(new Source::Controller(source_config(), this)); text_vec_.push_back(new Source::Controller(source_config(), this));
linenumbers_vec_.push_back(new Source::Controller(source_config(), this)); linenumbers_vec_.push_back(new Source::Controller(source_config(), this));
scrolledline_vec_.push_back(new Gtk::ScrolledWindow()); scrolledline_vec_.push_back(new Gtk::ScrolledWindow());
@ -329,6 +343,7 @@ void Notebook::Controller::OnCreatePage() {
} }
void Notebook::Controller::OnCloseCurrentPage() { void Notebook::Controller::OnCloseCurrentPage() {
INFO("Notebook close page");
// TODO(oyvang) zalox, forgi) // TODO(oyvang) zalox, forgi)
// Save a temp file, in case you close one you dont want to close? // Save a temp file, in case you close one you dont want to close?
if (Pages() != 0) { if (Pages() != 0) {
@ -372,6 +387,7 @@ void Notebook::Controller::OnEditCut() {
} }
std::string Notebook::Controller::GetCursorWord() { std::string Notebook::Controller::GetCursorWord() {
INFO("Notebook get cursor word");
int page = CurrentPage(); int page = CurrentPage();
std::string word; std::string word;
Gtk::TextIter start, end; Gtk::TextIter start, end;
@ -399,6 +415,7 @@ void Notebook::Controller::OnEditSearch() {
} }
void Notebook::Controller::Search(bool forward) { void Notebook::Controller::Search(bool forward) {
INFO("Notebook search");
int page = CurrentPage(); int page = CurrentPage();
std::string search_word; std::string search_word;
search_word = entry_.text(); search_word = entry_.text();
@ -460,6 +477,7 @@ void Notebook::Controller::OnBufferChange() {
void Notebook::Controller void Notebook::Controller
::OnDirectoryNavigation(const Gtk::TreeModel::Path& path, ::OnDirectoryNavigation(const Gtk::TreeModel::Path& path,
Gtk::TreeViewColumn* column) { Gtk::TreeViewColumn* column) {
INFO("Notebook directory navigation");
Gtk::TreeModel::iterator iter = directories().m_refTreeModel->get_iter(path); Gtk::TreeModel::iterator iter = directories().m_refTreeModel->get_iter(path);
if (iter) { if (iter) {
Gtk::TreeModel::Row row = *iter; Gtk::TreeModel::Row row = *iter;
@ -539,6 +557,7 @@ void Notebook::Controller::PopupSelectHandler(Gtk::Dialog &popup,
void Notebook::Controller::PopupSetSize(Gtk::ScrolledWindow &scroll, void Notebook::Controller::PopupSetSize(Gtk::ScrolledWindow &scroll,
int &current_x, int &current_x,
int &current_y) { int &current_y) {
INFO("Notebook popup set size");
int textview_x = CurrentTextView().get_width(); int textview_x = CurrentTextView().get_width();
int textview_y = 150; int textview_y = 150;
bool is_never_scroll_x = true; bool is_never_scroll_x = true;
@ -573,6 +592,7 @@ void Notebook::Controller::FindPopupPosition(Gtk::TextView& textview,
int popup_y, int popup_y,
int &x, int &x,
int &y) { int &y) {
INFO("Notebook popup find position");
Gdk::Rectangle temp1, temp2; Gdk::Rectangle temp1, temp2;
textview.get_cursor_locations( textview.get_cursor_locations(
CurrentTextView(). CurrentTextView().
@ -602,6 +622,7 @@ void Notebook::Controller::FindPopupPosition(Gtk::TextView& textview,
} }
void Notebook::Controller:: OnSaveFile() { void Notebook::Controller:: OnSaveFile() {
INFO("Notebook save file");
if (text_vec_.at(CurrentPage())->is_saved()) { if (text_vec_.at(CurrentPage())->is_saved()) {
std::ofstream file; std::ofstream file;
file.open (text_vec_.at(CurrentPage())->path()); file.open (text_vec_.at(CurrentPage())->path());
@ -622,16 +643,23 @@ void Notebook::Controller:: OnSaveFile() {
std::string Notebook::Controller::OnSaveFileAs(){ std::string Notebook::Controller::OnSaveFileAs(){
INFO("Notebook save as");
Gtk::FileChooserDialog dialog("Please choose a file", Gtk::FileChooserDialog dialog("Please choose a file",
Gtk::FILE_CHOOSER_ACTION_SAVE); Gtk::FILE_CHOOSER_ACTION_SAVE);
DEBUG("SET TRANSISTEN FPR");
dialog.set_transient_for(*window_); dialog.set_transient_for(*window_);
dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS); dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS);
dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL);
dialog.add_button("_Save", Gtk::RESPONSE_OK); dialog.add_button("_Save", Gtk::RESPONSE_OK);
//dialog.set_current_name("Untitled");
DEBUG("RUN DIALOG");
int result = dialog.run(); int result = dialog.run();
DEBUG("DIALOG RUNNING");
switch (result) { switch (result) {
case(Gtk::RESPONSE_OK): { case(Gtk::RESPONSE_OK): {
DEBUG("get_filename()");
std::string path = dialog.get_filename(); std::string path = dialog.get_filename();
DEBUG_VAR(path);
unsigned pos = path.find_last_of("/\\"); unsigned pos = path.find_last_of("/\\");
std::cout << path<< std::endl; std::cout << path<< std::endl;
//notebook_.OnSaveFile(path); //notebook_.OnSaveFile(path);

3
juci/source.cc

@ -356,7 +356,7 @@ void Source::Controller::OnOpenFile(const string &filepath) {
notebook_->index()); notebook_->index());
view().OnUpdateSyntax(model().ExtractTokens(start_offset, end_offset), view().OnUpdateSyntax(model().ExtractTokens(start_offset, end_offset),
model().config()); model().config());
}
buffer()->signal_end_user_action().connect([this]() { buffer()->signal_end_user_action().connect([this]() {
if (!go) { if (!go) {
@ -396,6 +396,7 @@ void Source::Controller::OnOpenFile(const string &filepath) {
syntax.unlock(); syntax.unlock();
} }
}); });
}
} }
Glib::RefPtr<Gtk::TextBuffer> Source::Controller::buffer() { Glib::RefPtr<Gtk::TextBuffer> Source::Controller::buffer() {
return view().get_buffer(); return view().get_buffer();

56
juci/terminal.cc

@ -1,6 +1,8 @@
#include "terminal.h" #include "terminal.h"
#include <iostream> #include <iostream>
#include <thread> #include <thread>
// #include <pstream.h>
// #include <string>
Terminal::View::View(){ Terminal::View::View(){
@ -21,32 +23,17 @@ void Terminal::Controller::SetFolderCommand( boost::filesystem::path
folder_command_ = "cd "+ path_ + "; "; folder_command_ = "cd "+ path_ + "; ";
} }
bool Terminal::Controller::Compile(){ void Terminal::Controller::Compile(){
if (running.try_lock()) { Terminal().get_buffer()->set_text("");
std::thread execute([=]() { ExecuteCommand("cmake .", "r");
Terminal().get_buffer()->set_text(""); if (ExistInConsole(cmake_sucsess)){
ExecuteCommand("cmake ."); ExecuteCommand("make", "r");
if (ExistInConsole(cmake_sucsess)){ }
ExecuteCommand("make");
}
});
execute.detach();
running.unlock();
if (ExistInConsole(make_built)) return true;
}
PrintMessage("juCi++ ERROR: Failed to compile project in directory"
+ path_ + "\n");
return false;
} }
void Terminal::Controller::Run(std::string executable) { void Terminal::Controller::Run(std::string executable) {
if (running.try_lock()) { PrintMessage("juCi++ execute: " + executable + "\n");
std::thread execute([=]() { ExecuteCommand("./"+executable, "r");
ExecuteCommand("./"+executable);
});
execute.detach();
running.unlock();
}
} }
void Terminal::Controller::PrintMessage(std::string message){ void Terminal::Controller::PrintMessage(std::string message){
@ -54,22 +41,6 @@ void Terminal::Controller::PrintMessage(std::string message){
insert(Terminal().get_buffer()-> end(),"> "+message); insert(Terminal().get_buffer()-> end(),"> "+message);
} }
// bool Terminal::Controller::FindExecutable(std::string executable) {
// std::string build = Terminal().get_buffer()->get_text();
// double pos = build.find(make_built);
// Gtk::TextIter start = Terminal().get_buffer()->get_iter_at_offset(pos);
// Gtk::TextIter end = Terminal().get_buffer()->get_iter_at_offset(pos);
// while (!end.ends_line()) {
// end.forward_char();
// }
// build = Terminal().get_buffer()->get_text(start, end);
// pos = build.find_last_of(" ");
// build = build.substr(pos+1);
// std::cout << "DEBUG: BUILD TARGET = "<< build << std::endl;
// std::cout << "EDEBUG: ECUTABLE FILE = "<< executable << std::endl;
// if(build != executable) return false;
// return true;
// }
bool Terminal::Controller::ExistInConsole(std::string string) { bool Terminal::Controller::ExistInConsole(std::string string) {
double pos = Terminal().get_buffer()-> double pos = Terminal().get_buffer()->
@ -78,14 +49,15 @@ bool Terminal::Controller::ExistInConsole(std::string string) {
return true; return true;
} }
void Terminal::Controller::ExecuteCommand(std::string command) { void Terminal::Controller::ExecuteCommand(std::string command, std::string mode) {
command = folder_command_+command; command = folder_command_+command;
std::cout << "EXECUTE COMMAND: "<< command << std::endl; std::cout << "EXECUTE COMMAND: "<< command << std::endl;
FILE* p = popen(command.c_str(), "r"); FILE* p = popen(command.c_str(), mode.c_str());
if (p == NULL) { if (p == NULL) {
PrintMessage("juCi++ ERROR: Failed to run command" + command + "\n"); PrintMessage("juCi++ ERROR: Failed to run command" + command + "\n");
}else { }else {
char buffer[1028]; char buffer[1028];
while (fgets(buffer, 1028, p) != NULL) { while (fgets(buffer, 1028, p) != NULL) {
PrintMessage(buffer); PrintMessage(buffer);
} }

6
juci/terminal.h

@ -25,17 +25,15 @@ namespace Terminal {
Gtk::TextView& Terminal(){return view_.textview();} Gtk::TextView& Terminal(){return view_.textview();}
void SetFolderCommand(boost::filesystem::path CMake_path); void SetFolderCommand(boost::filesystem::path CMake_path);
void Run(std::string executable); void Run(std::string executable);
bool Compile(); void Compile();
private: private:
void ExecuteCommand(std::string command); void ExecuteCommand(std::string command, std::string mode);
bool OnButtonRealeaseEvent(GdkEventKey* key); bool OnButtonRealeaseEvent(GdkEventKey* key);
bool ExistInConsole(std::string string); bool ExistInConsole(std::string string);
// bool FindExecutable(std::string executable);
void PrintMessage(std::string message); void PrintMessage(std::string message);
Terminal::View view_; Terminal::View view_;
std::string folder_command_; std::string folder_command_;
std::string path_; std::string path_;
std::mutex running;
const std::string cmake_sucsess = "Build files have been written to:"; const std::string cmake_sucsess = "Build files have been written to:";
const std::string make_built = "Built target"; const std::string make_built = "Built target";
const std::string make_executable = "Linking CXX executable"; const std::string make_executable = "Linking CXX executable";

113
juci/window.cc

@ -33,53 +33,71 @@ Window::Window() :
}); });
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSaveAs", keybindings_.action_group_menu()->add(Gtk::Action::create("FileSaveAs",
"Save as"), "Save as"),
Gtk::AccelKey(keybindings_.config_ Gtk::AccelKey(keybindings_.config_
.key_map()["save_as"]), .key_map()["save_as"]),
[this]() { [this]() {
notebook_.OnSaveFile(); notebook_.OnSaveFile();
}); });
keybindings_.action_group_menu()->add(Gtk::Action::create("FileSave", keybindings_.action_group_menu()->add(Gtk::Action::create("FileSave",
"Save"), "Save"),
Gtk::AccelKey(keybindings_.config_ Gtk::AccelKey(keybindings_.config_
.key_map()["save"]), .key_map()["save"]),
[this]() { [this]() {
notebook_.OnSaveFile(); notebook_.OnSaveFile();
}); });
keybindings_.
action_group_menu()->
add(Gtk::Action::create("ProjectCompileAndRun",
"Compile And Run"),
Gtk::AccelKey(keybindings_.config_
.key_map()["compile_and_run"]),
[this]() {
notebook_.OnSaveFile();
std::string path = notebook_.CurrentPagePath();
terminal_.SetFolderCommand(path);
if(terminal_.Compile()) {
std::string executable = notebook_.directories().
GetCmakeVarValue(path,"add_executable");
terminal_.Run(executable);
}
});
keybindings_. keybindings_.
action_group_menu()-> action_group_menu()->
add(Gtk::Action::create("ProjectCompile", add(Gtk::Action::create("ProjectCompileAndRun",
"Compile"), "Compile And Run"),
Gtk::AccelKey(keybindings_.config_ Gtk::AccelKey(keybindings_.config_
.key_map()["compile"]), .key_map()["compile_and_run"]),
[this]() { [this]() {
notebook_.OnSaveFile(); notebook_.OnSaveFile();
std::string path = if (running.try_lock()) {
notebook_.CurrentPagePath(); std::thread execute([=]() {
terminal_.SetFolderCommand(path); std::string path = notebook_.CurrentPagePath();
terminal_.Compile(); int pos = path.find_last_of("/\\");
}); if(pos != std::string::npos){
path.erase(path.begin()+pos,path.end());
this->signal_button_release_event(). terminal_.SetFolderCommand(path);
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); }
terminal_.Compile();
std::string executable = notebook_.directories().
GetCmakeVarValue(path,"add_executable");
terminal_.Run(executable);
});
execute.detach();
running.unlock();
}
});
keybindings_.
action_group_menu()->
add(Gtk::Action::create("ProjectCompile",
"Compile"),
Gtk::AccelKey(keybindings_.config_
.key_map()["compile"]),
[this]() {
notebook_.OnSaveFile();
if (running.try_lock()) {
std::thread execute([=]() {
std::string path = notebook_.CurrentPagePath();
int pos = path.find_last_of("/\\");
if(pos != std::string::npos){
path.erase(path.begin()+pos,path.end());
terminal_.SetFolderCommand(path);
}
terminal_.Compile();
});
execute.detach();
running.unlock();
}
});
this->signal_button_release_event().
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false);
terminal_.Terminal().signal_button_release_event(). terminal_.Terminal().signal_button_release_event().
connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false); connect(sigc::mem_fun(*this,&Window::OnMouseRelease),false);
@ -88,9 +106,12 @@ Window::Window() :
keybindings_.BuildMenu(); keybindings_.BuildMenu();
window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK); window_box_.pack_start(menu_.view(), Gtk::PACK_SHRINK);
window_box_.pack_start(notebook_.entry_view(), Gtk::PACK_SHRINK); window_box_.pack_start(notebook_.entry_view(), Gtk::PACK_SHRINK);
window_box_.pack_start(notebook_.view()); paned_.set_position(300);
window_box_.pack_end(terminal_.view(),Gtk::PACK_SHRINK); paned_.pack1(notebook_.view(), true, false);
paned_.pack2(terminal_.view(), true, true);
window_box_.pack_end(paned_);
show_all_children(); show_all_children();
INFO("Window created"); INFO("Window created");
} // Window constructor } // Window constructor

3
juci/window.h

@ -26,11 +26,12 @@ public:
Keybindings::Controller& keybindings() { return keybindings_; } Keybindings::Controller& keybindings() { return keybindings_; }
private: private:
std::mutex running;
Gtk::VPaned paned_;
//signal handlers //signal handlers
void OnWindowHide(); void OnWindowHide();
void OnOpenFile(); void OnOpenFile();
void OnFileOpenFolder(); void OnFileOpenFolder();
bool OnMouseRelease(GdkEventButton* button); bool OnMouseRelease(GdkEventButton* button);
}; };

Loading…
Cancel
Save