Revision [32955]

This is an old revision of gtkdialogDocTips9.10 made by zigbert on 2020-08-04 20:21:31.

 

HomePage > SoftwareIndex Software Index > SoftwareDevelopment Development > gtkdialog gtkdialog > gtkdialogDocTips Tips and Tricks

9.10 Define unique gtk-theme


Sometimes it is nice to change the gtktheme just for my app. Like this I get more options for my gtkdialog script.

Gtkdialog does not support monospace in the <edit> widget, but I can make it work by adding a unique gtk-theme only for my app. The best way to this is to add my new gtk-theme on top of the already existing. Now my gtk-theme can hold ONLY information about monospace, else it will use gtk-settings specified by user.

By giving the text-widget a name (see example), it is possible to have a gtk-theme for only this unique text string. This also works for text in widgets like <entry>.

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




Categories
CategoryGtkdialog
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki