Revision history for gtkdialogDocTips9.10
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
===@@**#%[[gtkdialogDocTips9.9|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.11|Next ❱❱❱]]#%**@@===
===@@**#%[[gtkdialogDocTips9.9|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.11|Next ❱❱❱]]#%**@@===
Deletions:
@@**#%[[gtkdialogDocTips9.9|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.11|Next ❱❱❱]]#%**@@
Additions:
**Mono font**
**Color all backgrounds**
How to control background color of different widgets.
[[https://forum.puppylinux.com/viewtopic.php?f=53&t=673 Forum Q/A:]]
echo 'style "specialbg"
bg[NORMAL]="#FF0"
base[NORMAL]="#FF0"
widget "*bg" style "specialbg"
class "GtkNotebook" style "specialbg"
class "GtkViewport" style "specialbg"' > /tmp/gtkrc_bg
export GTK2_RC_FILES=/tmp/gtkrc_bg:/root/.gtkrc-2.0
echo $'
<vbox width-request="280">
<notebook>
<edit name="bg"><default>This edit widget has a yellow background</default></edit>
<vbox name="bg"><text label="This vbox contains a text widget\nand backround of the whole box\nneeds to be made same\nas edit widget in Page1. How? Like so"></text></vbox>
<vbox name="bg" scrollable="true"><text label="This scrollable vbox contains a text widget and backround of the whole box\nneeds to be made same as edit widget in Page1. How? Aha!"></text></vbox>
</notebook>
<button></button>
</vbox>' | gtkdialog -s
**Color all backgrounds**
How to control background color of different widgets.
[[https://forum.puppylinux.com/viewtopic.php?f=53&t=673 Forum Q/A:]]
echo 'style "specialbg"
bg[NORMAL]="#FF0"
base[NORMAL]="#FF0"
widget "*bg" style "specialbg"
class "GtkNotebook" style "specialbg"
class "GtkViewport" style "specialbg"' > /tmp/gtkrc_bg
export GTK2_RC_FILES=/tmp/gtkrc_bg:/root/.gtkrc-2.0
echo $'
<vbox width-request="280">
<notebook>
<edit name="bg"><default>This edit widget has a yellow background</default></edit>
<vbox name="bg"><text label="This vbox contains a text widget\nand backround of the whole box\nneeds to be made same\nas edit widget in Page1. How? Like so"></text></vbox>
<vbox name="bg" scrollable="true"><text label="This scrollable vbox contains a text widget and backround of the whole box\nneeds to be made same as edit widget in Page1. How? Aha!"></text></vbox>
</notebook>
<button></button>
</vbox>' | gtkdialog -s
Additions:
====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
@@**#%[[gtkdialogDocTips9.9|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.11|Next ❱❱❱]]#%**@@
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
@@**#%[[gtkdialogDocTips9.9|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.11|Next ❱❱❱]]#%**@@
Deletions:
Progressbars are by default rather big, and it's not that easy to redefine the width of them. To do this you have to combine some attributes.
<hbox>
<vbox>
<progressbar width-request="100" height-request="20" Expand="no" Fill="no">
<input>echo 70; echo small bar</input>
</progressbar>
</vbox>
</hbox>
@@**#%[[gtkdialogDocTips9.8|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.10|Next ❱❱❱]]#%**@@