Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 15:26
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Gtkdialog: tooltip background: how to fill the whole bg?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
Bert


Joined: 30 Jun 2006
Posts: 927

PostPosted: Sun 09 Feb 2014, 08:32    Post subject:  Gtkdialog: tooltip background: how to fill the whole bg?
Subject description: [SOLVED]
 

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:



Code:
<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, 08:24; edited 1 time in total
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Sun 09 Feb 2014, 10:12    Post subject:  

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:
#!/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

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
Bert


Joined: 30 Jun 2006
Posts: 927

PostPosted: Mon 10 Feb 2014, 18:43    Post subject:  

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:
#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:
#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

_________________


Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Tue 11 Feb 2014, 16:38    Post subject:  

Be aware that some gtk-themes are hard to override. Try the Flat-grey or Stardust, as these has never given trouble for me.
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1063

PostPosted: Tue 11 Feb 2014, 17:40    Post subject:  

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

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Bert


Joined: 30 Jun 2006
Posts: 927

PostPosted: Sat 15 Feb 2014, 08:20    Post subject:  

Thanks SFR! Working now Wink
Code:

#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=" "
Smile
_________________


Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0618s ][ Queries: 11 (0.0088s) ][ GZIP on ]