Gtkdialog: tooltip background: how to fill the whole bg?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Gtkdialog: tooltip background: how to fill the whole bg?

#1 Post by Bert »

Hi all,

With a longer tooltip, I get these grey ends of line.

Here I exaggerated the amount of text a bit for the screenshot:

Image

Code: Select all

<button tooltip-markup="<span fgcolor='"'blue'"' bgcolor='"'lightyellow'"'> '$(gettext 'Lorem ipsum 
Is there a trick to make the tooltip background 100% "light-yellow"?

Thanks in advance!
Last edited by Bert on Sat 15 Feb 2014, 12:24, edited 1 time in total.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

I don't know the exact code, but you can sure set tooltip colors in an extra gtktheme.
The following example shows to do it (for monospace text).

Code: Select all

#!/bin/bash
echo 'style "specialmono"
{
  font_name="Mono 12"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono

export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0

export test_app="
<vbox>
  <text name=\"mono\"><label>This text-widget uses monospace font....</label></text>
  <text><label>...while this text-widget don't.</label></text>
  <edit><default>All edit-widgets gets monospace.</default></edit>
</vbox>"
gtkdialog --program=test_app

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#3 Post by Bert »

Thank you Zigbert,

I've been trying your idea, but didn't get results.

There was already a global "special" gtktheme in the dialog (as you can see from the fonts in the screenshot above).

At first I tried to integrate the tooltip stuff in that gtktheme. Didn't work. Then I added a new theme, following your example:

Code: Select all

#setting tooltip style...
echo 'style "specialtooltip" 
{ 
  font_name="Sans 10" 
  font_style="bold"
  fg[NORMAL]="blue"
  bg[NORMAL]="lightyellow"
} 
widget "*specialtooltip" style "specialtooltip" 
class "GtkTooltip*" style "specialtooltip"' > /tmp/gtkrc_specialtooltip
Tried another example (from SFR I think):

Code: Select all

#setting tooltip style..
FONT_NAME="Sans"
FONT_SIZE="10"
FONT_STYLE="bold"
echo 'style "custom1"
{
font_name="'$FONT_NAME' '$FONT_STYLE' '$FONT_SIZE'"
fg[NORMAL]="blue"
bg[NORMAL]="lightyellow"
}
widget "*GtkTooltip*" style "custom1" ' > /tmp/gtkrc_custom1
export GTK2_RC_FILES="${HOME}/.gtkrc-2.0:/tmp/gtkrc_custom1"
Again no luck.
I'm sure you are right and that it is possible, but I have to give up.
It is also not that important :wink:
It taught me to keep tooltips sweet and short...

Thanks again,
Bert
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#4 Post by zigbert »

Be aware that some gtk-themes are hard to override. Try the Flat-grey or Stardust, as these has never given trouble for me.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#5 Post by SFR »

Did some trials and replacing "*GtkTooltip*" with just "*tooltip*" gave me control over tooltip's style.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#6 Post by Bert »

Thanks SFR! Working now ;)

Code: Select all

#setting tooltip style..
FONT_NAME="Sans"
FONT_SIZE="10"
FONT_STYLE="bold"
echo 'style "customtooltip"
{
font_name="'$FONT_NAME' '$FONT_STYLE' '$FONT_SIZE'"
fg[NORMAL]="blue"
bg[NORMAL]="lightyellow"
}
widget "*tooltip*" style "customtooltip" ' > /tmp/gtkrc_customtooltip
export GTK2_RC_FILES="${HOME}/.gtkrc-2.0:/tmp/gtkrc_customtooltip"

export DIALOG='

<frame>
	      <edit text-name="tooltip" tooltip-text=" "
:-)
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

Post Reply