SDL2 Events [SOLVED] lazarus / 39-Graphics ---------------------------------------------------------------------- Pe3s · 2024-11-28 08:11 Hello, I moved the procedure to a separate module and there was an error with the Close function. Self.Close also does not work. How can I solve this ? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TSDLImageViewer.ProcessSDLEvents;begin  while SDL_PollEvent(@SDLEvent) <> 0 dobegin  case SDLEvent.type_ of  SDL_DROPFILE:    begin      HandleDropEvent(SDLEvent.drop.file_);      SDL_free(SDLEvent.drop.file_);    end;  SDL_QUITEV:    begin      Close;    end;  end;  end;end;     Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i core.pas(124,7) Error: Wrong number of parameters specified for call to "Close"file.inc(481,11) Error: Found declaration: Close(var File);text.inc(162,11) Error: Found declaration: Close(var Text); ---------------------------------------------------------------------- ackarwow · 2024-11-28 08:19 Quote from: Pe3s on November 28, 2024, 09:11:23 amHello, I moved the procedure to a separate module and there was an error with the Close function. Self.Close also does not work. How can I solve this ? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TSDLImageViewer.ProcessSDLEvents;begin  while SDL_PollEvent(@SDLEvent) <> 0 dobegin  case SDLEvent.type_ of  SDL_DROPFILE:    begin      HandleDropEvent(SDLEvent.drop.file_);      SDL_free(SDLEvent.drop.file_);    end;  SDL_QUITEV:    begin      Close;    end;  end;  end;end;     Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i core.pas(124,7) Error: Wrong number of parameters specified for call to "Close"file.inc(481,11) Error: Found declaration: Close(var File);text.inc(162,11) Error: Found declaration: Close(var Text);  Hi, Maybe you need to pass your form as input parameter of the procedure: TSDLImageViewer.ProcessSDLEvents(aForm: TForm) and then change Close to "aForm.Close"; ---------------------------------------------------------------------- Pe3s · 2024-11-28 08:30 I tried with Halt(0) works a le whether it is a good idea. One more question How does the mode invoke Application.OnIdle := from a separate module ?