[Lazarus] Not restored Screen.ActiveForm after InputQuery

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Not restored Screen.ActiveForm after InputQuery

Free Pascal - Lazarus mailing list
CudaText for Linux gtk2 x64.
its Python API fails when it reads current form, after plugin shows
InputQuery dialog.
I added test ShowMessage near the showing InputQuery and found that
after InputQ call, program reads empty Screen.ActiveForm.
marked by comment.
is it LCL bug?
LCL must restore ActiveForm after InputQuery.
IDE r63175.

function Py_dlg_input(Self, Args : PPyObject): PPyObject; cdecl;
var
   P1, P2: PChar;
   StrCaption, StrVal: string;
   t: string;
begin
   with AppPython.Engine do
     if Bool(PyArg_ParseTuple(Args, 'ss:dlg_input', @P1, @P2)) then
     begin
       StrCaption:= string(P1);
       StrVal:= string(P2);

       t:= screen.ActiveForm.caption;////this works

       if InputQuery(msgTitle, StrCaption, StrVal) then
         Result:= PyString_FromString(PChar(StrVal))
       else
         Result:= ReturnNone;

       t+= ', '+screen.ActiveForm.caption; //this crashes
       showmessage(t);
     end
   else
     Result:= ReturnNone;
end;

Alexey Torgashin

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus