diff --git a/reference/FileSelLazyIcon/FileSelLazyIcon.upp b/reference/FileSelLazyIcon/FileSelLazyIcon.upp index 0da717ba0..d1d146a14 100644 --- a/reference/FileSelLazyIcon/FileSelLazyIcon.upp +++ b/reference/FileSelLazyIcon/FileSelLazyIcon.upp @@ -1,7 +1,8 @@ description "Demostrates FileSel features that uses separate thread to resolve file image\377"; uses - CtrlLib; + CtrlLib, + plugin/jpg; file main.cpp; diff --git a/reference/FileSelLazyIcon/main.cpp b/reference/FileSelLazyIcon/main.cpp index 0028d484b..1917a78f7 100644 --- a/reference/FileSelLazyIcon/main.cpp +++ b/reference/FileSelLazyIcon/main.cpp @@ -1,16 +1,14 @@ #include +#include using namespace Upp; -static void sLoadImage(const String& path, Image& result) -{ - result = StreamRaster::LoadFileAny(path); -} - GUI_APP_MAIN { FileSel fs; fs.AllFilesType(); - fs.WhenIconLazy = sLoadImage; + fs.WhenIconLazy = [](const String& path, Image& result) { + result = StreamRaster::LoadFileAny(path); + }; fs.ExecuteOpen(); }