light_adder.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <gtkmm/grid.h>
  2. #include <gtkmm/label.h>
  3. #include <gtkmm/entry.h>
  4. #include <gtkmm/button.h>
  5. #include "light_adder.hpp"
  6. namespace cx_light {
  7. light_adder::light_adder() {
  8. this->title_label = new Gtk::Label("Title");
  9. this->title_entry = new Gtk::Entry();
  10. this->address_label = new Gtk::Label("Address");
  11. this->address_entry = new Gtk::Entry();
  12. this->add_button = new Gtk::Button("Add");
  13. this->attach(*this->title_label, 0, 0);
  14. this->attach(*this->title_entry, 1, 0);
  15. this->attach(*this->address_label, 0, 1);
  16. this->attach(*this->address_entry, 1, 1);
  17. this->attach(*this->add_button, 0, 2, 2, 1);
  18. }
  19. light_adder::~light_adder() {
  20. this->remove(*this->title_label);
  21. this->remove(*this->title_entry);
  22. this->remove(*this->address_label);
  23. this->remove(*this->address_entry);
  24. this->remove(*this->add_button);
  25. delete this->title_label;
  26. delete this->title_entry;
  27. delete this->address_label;
  28. delete this->address_entry;
  29. delete this->add_button;
  30. }
  31. }