Re-hello Alexander.
If you dont want to use global "threadruns" var you may do like this:
procedure tmainfo.ticktack(const sender: tthreadcomp);
var t : TSystemTime;
begin
while not sender.terminated do begin // DO THIS
GetLocalTime(t);
if (year <> t.Year) or (month <> t.Month) or (day <> t.Day)
or (hour <> t.Hour) or (minute <> t.Minute) then
begin
year := t.Year; month := t.Month; day := t.Day;
hour := t.Hour; minute := t.Minute;
mainfo.tlabel2.Caption := IntToStr(hour) + ':' + IntToFix2Str(minute) + ' ' +
mon_name[month] + ' (' + IntToStr(month) + ') ' +
wdn[Weekday(year, month, day)] + ' ' + IntToStr(day) + ' ' + IntToStr(year);
end;
sleep(1000);
end;
end;
procedure tmainfo.onquit(Const Sender: TObject);
begin
tthreadcomp1.terminate;
application.ProcessMessages;
Close;
end;
________________________________
De : Alexander via mseide-msegui-talk <[email protected]>
Envoyé : mercredi 7 juillet 2021 15:52
À : [email protected]
<[email protected]>
Cc : Alexander <[email protected]>
Objet : Re: [MSEide-MSEgui-talk] tthreadcomp and try it in GALAXY ORGANIZER
tthreadcomp1.Terminate; before Close ? Problem stay up.
When run from MSE also see error message instead "Exit normally" (see attach)
On Wed, 7 Jul 2021 12:10:39 +0000
Fred van Stappen <[email protected]> wrote:
> Hello Alexander.
>
> Imho, it is normal because the thread was not terminated before close.
>
> Could you try with the project in attachment?
> This terminates the thread before close.
> Even if you run via terminal, the application will close when click on "Quit".
>
> Fre;D
>
> ________________________________
> De : Alexander via mseide-msegui-talk
> <[email protected]>
> Envoyé : mercredi 7 juillet 2021 12:21
> À : [email protected]
> <[email protected]>
> Cc : Alexander <[email protected]>
> Objet : Re: [MSEide-MSEgui-talk] tthreadcomp and try it in GALAXY ORGANIZER
>
> I attach "ovaleclock".
>
> If it run, then all Ok.
> But if press Quit button GUI hide but exit in console not occur. Only Ctrl+C
> for exit.
> If I use thread from classes exit correctly.
>
> On Wed, 7 Jul 2021 09:04:22 +0000
> Fred van Stappen <[email protected]> wrote:
>
> > Hello Alexander.
> >
> > Like always I need to sent some mail before I understand.
> >
> > > Program or hang long time or crash with SEGFAULT.
> > > I return (non-visual) thread from "classes" as in "gorgclocken".
> >
> > About the error, I suppose that you are talking about your "gorgclocken"
> > program.
> > Indeed after running gorgclocken and close it, there is that error message:
> >
> > XIO: fatal IO error 11 (Resource temporarily unavailable) on X server
> > ":0.0"
> > after 40 requests (30 known processed) with 0 events remaining.
> >
> > I did try to run + close the demo "ovaleform.pas" that I give in a previous
> > post.
> > But this one close without any error.
> >
> > So maybe I did not catch something, do you have problems with msegui too?
> >
> > Fre;D
> >
> >
> >
> > XIO: fatal IO error 11 (Resource temporarily unavailable) on X server
> > ":0.0"
> > after 40 requests (30 known processed) with 0 events remaining.
> >
> > ________________________________
> > De : Alexander via mseide-msegui-talk
> > <[email protected]>
> > Envoyé : mercredi 7 juillet 2021 08:07
> > À : [email protected]
> > <[email protected]>
> > Cc : Alexander <[email protected]>
> > Objet : [MSEide-MSEgui-talk] tthreadcomp and try it in GALAXY ORGANIZER
> >
> > Hi,
> >
> > I add to "ovale" tthreadcomp and make thread as in
> > http://soft.self-made-free.ru/gorgclocken.tar.xz
> >
> > tthreadcomp running normally, but crash program on exit. Program or hang
> > long time or crash with SEGFAULT.
> > I return (non-visual) thread from "classes" as in "gorgclocken".
> >
> > I send email to Nikolay Nikolov
> > (https://sourceforge.net/u/nickysn/profile/) about translate libXExt to
> > Pascal.
> > And may be need translate to Pascal libxcb. https://xcb.freedesktop.org/
> > and Wayland.
> >
> > After works about all this problems may be write some suggest to xorg,
> > xlib, xcb, fsf and more
> > for better organization of Free Software.
> >
> > Good Luck,
> > Alexander.
> >
> >
> > _______________________________________________
> > mseide-msegui-talk mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk