tv_rename/gtk/progresswindow.hpp

28 lines
688 B
C++
Raw Normal View History

2020-01-17 13:06:31 +00:00
#ifndef GTKMM_PROGRESS_WINDOW
#define GTKMM_PROGRESS_WINDOW
#include <gtkmm/label.h>
#include <gtkmm/layout.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/window.h>
class ProgressWindow : public Gtk::Window {
public:
ProgressWindow();
virtual ~ProgressWindow() = default;
void setPerc( int perc ) {
2020-04-01 14:13:39 +00:00
pb->set_fraction( perc / 100.0 );
2020-01-17 13:06:31 +00:00
}
void setLabel( const std::string &text ) {
label->set_text( text );
}
2020-04-01 14:13:39 +00:00
2020-01-17 13:06:31 +00:00
private:
std::unique_ptr< Gtk::Layout > layout{ new Gtk::Layout() };
2020-04-01 14:13:39 +00:00
std::unique_ptr< Gtk::Label > label{ new Gtk::Label() };
std::unique_ptr< Gtk::ProgressBar > pb{ new Gtk::ProgressBar() };
2020-01-17 13:06:31 +00:00
};
#endif // GTKMM_MAIN_WINDOW