Balloons

Post

Posted
Rating:
#1 (In Topic #451)
Avatar
Guru
cogier is in the usergroup ‘Guru’
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.

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Balloon.Info("Hello World!", Button1)
  4.  
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
cage is in the usergroup ‘Regular’
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.
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
vuott is in the usergroup ‘Regular’

cogier said

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 !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
 My balloon text is white on black
but you can use this to make it more visible

Balloon.Font = Font["Arial,18,Bold,italic"]
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Guru
cogier is in the usergroup ‘Guru’
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?
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
But changing to QT requires a major rewrite of the program  :(

That is probably because I don't write the program correctly
Online now: No Back to the top

Post

Posted
Rating:
#7
Regular
vuott is in the usergroup ‘Regular’

cogier said

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 !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#8
Guru
BruceSteers is in the usergroup ‘Guru’
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

Code (gambas)

  1. Balloon.Background = Color.Blue
  2. Balloon.Foreground = Color.Yellow
  3.  

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……

 :)
Online now: No Back to the top

Post

Posted
Rating:
#9
Guru
BruceSteers is in the usergroup ‘Guru’
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
Online now: No Back to the top

Post

Posted
Rating:
#10
Guru
BruceSteers is in the usergroup ‘Guru’
I'm a bit more experienced at merge requests now Charlie so I've re-submitted a request for Balloon colour properties.

Balloon.class: Add Background and Foreground color properties. (4a1a63d4) · Commits · Bruce Steers / gambas · GitLab

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 :)
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Guru
cogier is in the usergroup ‘Guru’
You are getting good at this Bruce  :D
Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Regular
cage is in the usergroup ‘Regular’
Bruce I think you should apply to be on the Gambas development team  :)
Online now: No Back to the top

Post

Posted
Rating:
#13
Guru
BruceSteers is in the usergroup ‘Guru’
In the latest commit
Tooltip and link properties of the Color class are now writable. Fix 'Key.Backspace' property name. (2c2b7d56) · Commits · Gambas / gambas · GitLab

Color.TooltipBackground and Color.TooltipForeground are now writeable :)

Ironically it does not affect tooltips but if you set the colours Balloon does use them :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.