Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.cpp
- //Большая часть программы скрыта за ненадобностью
- #include <FL/Fl.H>
- #include <FL/Fl_Button.H>
- #include <FL/Fl_Input.H>
- #include <FL/Fl_Native_File_Chooser.H>
- #include "Fl_Canvas.h"
- #include <string>
- #include "effects.h"
- void ChooseNewImagesCb(Fl_Widget* widget, void* data)
- {
- Fl_Native_File_Chooser* chooser = new Fl_Native_File_Chooser(Fl_Native_File_Chooser::BROWSE_FILE);
- chooser->title("Choise images...");
- chooser->filter("Изображения\t*.{jpg,png,bmp,gif}");
- chooser->show();
- Fl_Canvas* _canvas = (Fl_Canvas*)data;
- _canvas->add_image(chooser->filename()); //Здесь я вызываю метод у которого по мнению компилятора, нету определния
- _canvas->redraw();
- }
- class Photoeditor : public Fl_Window
- {
- public:
- Photoeditor(int w, int h, const char* title) : Fl_Window(w, h, title) {
- Fl_Canvas* canvas = new Fl_Canvas(FL_BORDER_BOX, 20, 40, 400, 400);
- /*Creating a button. Its opens a dialog box with image selection*/
- int button_x = 10, button_y = 10,
- button_width = 60, button_hight = 15;
- Fl_Button* load_image = new Fl_Button(button_x, button_y, button_width, button_hight, "image");
- load_image->callback(ChooseNewImagesCb, canvas);
- resizable(this);
- show();
- }
- };
- int main()
- {
- fl_register_images();
- Photoeditor photoeditor(640, 480, "photoeditor");
- Fl::run();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement