Tutorial |
||
|
||
|
FileSelection(); explicit FileSelection(const String& title); |
void
set_filename(const String& filename); |
String get_filename() const; |
Gtk::Entry*
selection_entry() const; Gtk::Label* selection_text() const; Gtk::Button* ok_button() const; Gtk::Button* cancel_button() const; Gtk::Button* help_button() const; |
#include<inti/main.h> #include <inti/gtk/fileselection.h> using namespace Inti; class FileSelection : public Gtk::FileSelection { protected: void on_ok(); public: FileSelection(); virtual ~FileSelection(); }; |
#include"filesel.h" #include <inti/gtk/button.h> #include <iostream> FileSelection::FileSelection() : Gtk::FileSelection("File selection") { ok_button()->sig_clicked().connect(slot(this, &FileSelection::on_ok)); cancel_button()->sig_clicked().connect(slot(this, &FileSelection::dispose)); // Lets set the filename, as if this were a save dialog, and we are giving a default filename. set_filename("penguin.png"); } FileSelection::~FileSelection() { } void FileSelection::on_ok() { std::cout << get_filename().c_str() << '\n'; } INTI_MAIN(FileSelection) |
|
|||
|
|||