uiAbout.cc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "uiAbout.hh"
  2. UiAbout::UiAbout(): m_Box(Gtk::Orientation::VERTICAL), m_Button("License"), m_Button1("Back"){
  3. set_title("About");
  4. set_default_size(250, 300);
  5. set_resizable(false);
  6. set_child(m_Box);
  7. m_Box.append(m_Box1);
  8. m_Box1.append(m_Button);
  9. m_Box1.append(m_Button1);
  10. m_Box1.set_homogeneous();
  11. m_Button.signal_clicked().connect(sigc::mem_fun(*this,
  12. &UiAbout::showLicense));
  13. m_Button1.signal_clicked().connect(sigc::mem_fun(*this,
  14. &Window::hide));
  15. }
  16. void UiAbout::showLicense(){
  17. m_Box.prepend(m_ScrolledWindow);
  18. m_ScrolledWindow.set_child(m_TextView);
  19. m_ScrolledWindow.set_policy(Gtk::PolicyType::AUTOMATIC, Gtk::PolicyType::AUTOMATIC);
  20. m_ScrolledWindow.set_expand();
  21. m_refTextBuffer = Gtk::TextBuffer::create();
  22. m_refTextBuffer->set_text("This program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the Free\nSoftware Foundation; either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\nmore details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program; if not, write to the Free Software Foundation, Inc., 51 Franklin\nStreet, Fifth Floor, Boston, MA 02110-1301, USA.");
  23. m_TextView.set_buffer(m_refTextBuffer);
  24. m_TextView.set_editable(false);
  25. }