Balloons

Post your Gambas programming questions here.
User avatar
cogier
Site Admin
Posts: 1117
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Balloons

Post by cogier »

Can anybody tell me how to change the background and foreground on Balloon?

Running the following code produces dark grey text on a black background.
Public Sub Form_Open()
  
  Balloon.Info("Hello World!", Button1)
  
End
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: Balloons

Post by cage »

Can anybody tell me how to change the background and foreground on Balloon?
As far as I can find out they are suppose to be linked to the color of the system notification colors. I tested out that theory and found it not to be true. Also I have not found any setting in Gambas preferences that change the color that works either. You might want to ask the author of Gambas to see if there is a work around. Sorry I wasn't any help.
vuott
Posts: 261
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: Balloons

Post by vuott »

cogier wrote: Saturday 29th August 2020 2:03pm Running the following code produces dark grey text on a black background.
...you are using GTK, aren't you ? ;)
Change graphic resource: use QT.

Obviously, then, you know that you can use the HTML protocol with the text of the "Ballon" ...
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Balloons

Post by grayghost4 »

My balloon text is white on black
but you can use this to make it more visible

Balloon.Font = Font["Arial,18,Bold,italic"]
User avatar
cogier
Site Admin
Posts: 1117
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Balloons

Post by cogier »

As far as I can find out they are suppose to be linked to the color of the system notification colors.
Thanks cage, I also looked for these settings but all I was able to do was read what they are and not set them.
My balloon text is white on black
but you can use this to make it more visible

Balloon.Font = Font["Arial,18,Bold,italic"]
Thanks grayghost4 but that doesn't change the colour.
..you are using GTK, aren't you ? ;)
Change graphic resource: use QT.
Thank vott, you are correct the colours are fine with QT but why not with GTK?
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Balloons

Post by grayghost4 »

But changing to QT requires a major rewrite of the program :(

That is probably because I don't write the program correctly
vuott
Posts: 261
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: Balloons

Post by vuott »

cogier wrote: Sunday 30th August 2020 9:48am Thank vott, you are correct the colours are fine with QT but why not with GTK?
It is the normal coloring of Ubuntu tooltips by using GTK.
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
BruceSteers
Posts: 1505
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Balloons

Post by BruceSteers »

I've been monkeying around with the Gambas source code.

My first test ,, try to add Background and Foreground to Balloon object :)
Successfully accomplished :)
i can now use something like
Balloon.Background = Color.Blue
Balloon.Foreground = Color.Yellow
and it works fine , by default it uses the Color.TooltipBackground and Color.TooltipForeground values as normal

Now i need to figure out how to add the changes for all......

:)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1505
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Balloons

Post by BruceSteers »

Well i think i did everything right.
I've created my own gitlab account , forked my own version of gambas.
added the Balloon colour changes, committed it to my fork.
and sent a merge request.

With any luck Charlie you'll have Balloon colour settings at some time or other :)
https://gitlab.com/bsteers4/gambas
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1505
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Balloons

Post by BruceSteers »

I'm a bit more experienced at merge requests now Charlie so I've re-submitted a request for Balloon colour properties.

https://gitlab.com/bsteers4/gambas/-/co ... efc5c9dda9

If not you could put the modified balloon class files in a project (like we did with Message) and voilla , custom colours not just the generic tooltip ones :)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply