Recent

Author Topic: [CLOSED] Why works sysutils.beep() in GUI-programs and not in console-programs?  (Read 5514 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Why works sysutils.beep() in GUI-programs and not in console-programs?
« Reply #15 on: September 01, 2021, 06:15:30 pm »
Hum, I dont have Konsole installed.

What if you use a other terminal like xterm, do you get some message too?
« Last Edit: September 01, 2021, 06:18:38 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Why works sysutils.beep() in GUI-programs and not in console-programs?
« Reply #16 on: September 01, 2021, 06:21:41 pm »
Maybe interesting:

https://forum.kde.org/viewtopic.php?f=227&t=48921

That window-message is part of Konsole program and can be enabled/disabled.
« Last Edit: September 01, 2021, 06:30:12 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Hartmut

  • Hero Member
  • *****
  • Posts: 749
Re: Why works sysutils.beep() in GUI-programs and not in console-programs?
« Reply #17 on: September 01, 2021, 06:32:46 pm »
No, xterm does not show such a small dialog window. But I think this does not lead into a direction in which I want. I want to "use" the existing small dialog window from "Konsole".

I decided to "solve" my problem in the following way: creating a minimal GUI-Program with just
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormActivate(Sender: TObject);
  2.    begin
  3.    sysutils.beep;
  4.    Close;
  5.    end;
and call this from my console program via TProcess or RunCommand etc.
Of course the opposite of "elegant", but if we can't find out, how FPC does it - I don't want to spend more time in such a small problem like doing a beep ;-)

Thanks again for your help.

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
And what about if you call sysutils.beep in your console app via a timer enabled after begin?

Code: Pascal  [Select][+][-]
  1. procedure proccallbeeptimer(sender : Tobject);
  2. begin
  3. timerbeep.enabled := false;
  4. application.processmessages; // THIS
  5. sysutils.beep;
  6. end;
« Last Edit: September 01, 2021, 06:48:27 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018