* * *

Author Topic: Trayicon: showballonhint when instead hint (eg.: when mouseover)  (Read 460 times)

dcminus

  • New member
  • *
  • Posts: 24
Hey

should be an easy one but could not think of an elegant way to do this. I would like to show a ballonhint when my cursor is over the trayicon.

thank you,

DC-



GAN

  • Full Member
  • ***
  • Posts: 139
Lazarus 1.6 FPC 3.0.0 Linux Mint Mate 17.2 x86_64 GTK-2
Zeos 7.1.3 - Sqlite 3.8.2

Foro Lazarus en español http://forum.lazarus.freepascal.org/index.php/board,73.0.html

GetMem

  • Hero Member
  • *****
  • Posts: 2750
Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
« Reply #2 on: January 31, 2018, 05:44:24 am »
Set BalloonFlags, BalloonHint, BalloonTimeOut then:
Code: Pascal  [Select]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   TrayIcon1.Show;
  4. end;
  5.  
  6. procedure TForm1.TrayIcon1MouseMove(Sender: TObject; Shift: TShiftState; X,
  7.   Y: Integer);
  8. begin
  9.   TrayIcon1.ShowBalloonHint;
  10. end;  

dcminus

  • New member
  • *
  • Posts: 24
Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
« Reply #3 on: February 03, 2018, 12:51:39 am »
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint

@GAN: hmm, that might be suitible for this.

GetMem

  • Hero Member
  • *****
  • Posts: 2750
Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
« Reply #4 on: February 03, 2018, 07:38:41 am »
Quote
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint
Works fine with Lazarus trunk/FPC 3.0.4, both under windows and linux. What is your configuration?

ASerge

  • Hero Member
  • *****
  • Posts: 590
Re: Trayicon: showballonhint when instead hint (eg.: when mouseover)
« Reply #5 on: February 03, 2018, 11:46:43 am »
@GetMem: tried the same, but it went blinking mad :/ i should probably add a check if it is already showing and only on mousemove if it is not visible, but could not find .visible for ballonhint
Also blinking. Windows 7, Lazarus 1.8
In my opinion, this property is used in different ways. To display information about the application (when you hover the mouse), the Hint property is used. But if the application itself does something and wants to attract the user's attention, then ShowBalloonHint is used. This hint automatically disappears through the specified interval to avoid annoying the user.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus