Page 1 of 2

Balloons

Posted: Saturday 29th August 2020 2:03pm
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

Re: Balloons

Posted: Saturday 29th August 2020 6:22pm
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.

Re: Balloons

Posted: Saturday 29th August 2020 10:26pm
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" ...

Re: Balloons

Posted: Sunday 30th August 2020 5:35am
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"]

Re: Balloons

Posted: Sunday 30th August 2020 9:48am
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?

Re: Balloons

Posted: Sunday 30th August 2020 6:10pm
by grayghost4
But changing to QT requires a major rewrite of the program :(

That is probably because I don't write the program correctly

Re: Balloons

Posted: Sunday 30th August 2020 10:40pm
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.

Re: Balloons

Posted: Thursday 8th October 2020 3:20pm
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......

:)

Re: Balloons

Posted: Thursday 8th October 2020 5:59pm
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

Re: Balloons

Posted: Thursday 24th December 2020 4:50pm
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 :)