MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / OnWindowCmd

Function OnWindowCmd

Applications/ImgView/main.cpp:35–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void OnWindowCmd(unsigned short cmd, Lemon::GUI::Window* win){
36 if(cmd == IMGVIEW_OPEN){
37 free(image.buffer);
38 if(LoadImage(Lemon::GUI::FileDialog("/"))){
39 exit(-1);
40 }
41 sv->RemoveWidget(imgWidget);
42 delete imgWidget;
43 imgWidget = new Lemon::GUI::Bitmap({{0, 0}, {0, 0}}, &image);
44 sv->AddWidget(imgWidget);
45 }
46}
47
48int main(int argc, char** argv){
49 if(argc > 1){

Callers

nothing calls this directly

Calls 4

FileDialogFunction · 0.85
LoadImageFunction · 0.70
RemoveWidgetMethod · 0.45
AddWidgetMethod · 0.45

Tested by

no test coverage detected