Revision history for gtkdialogDocTips8


Revision [33330]

Last edited on 2023-02-24 06:54:14 by zigbert
Additions:
[[gtkdialogDocTips8/#hn_8.1| Some options for the <text> widget]]
[[gtkdialogDocTips8/#hn_8.2| Advanced text layout]]
[[gtkdialogDocTips8/#hn_8.3| Scroll text]]
[[gtkdialogDocTips8/#hn_8.4| Strikethrough text]]
[[gtkdialogDocTips8/#hn_8.5| Set font]]
[[gtkdialogDocTips8/#hn_8.6| Hyperlink]]
Deletions:
1) [[gtkdialogDocTips8/#hn_8.1| Some options for the <text> widget]]
2) [[gtkdialogDocTips8/#hn_8.2| Advanced text layout]]
3) [[gtkdialogDocTips8/#hn_8.3| Scroll text]]
4) [[gtkdialogDocTips8/#hn_8.4| Strikethrough text]]
5) [[gtkdialogDocTips8/#hn_8.5| Set font]]
6) [[gtkdialogDocTips8/#hn_8.6| Hyperlink]]


Revision [33328]

Edited on 2023-02-24 06:50:33 by zigbert
Additions:
1) [[gtkdialogDocTips8/#hn_8.1| Some options for the <text> widget]]
2) [[gtkdialogDocTips8/#hn_8.2| Advanced text layout]]
3) [[gtkdialogDocTips8/#hn_8.3| Scroll text]]
4) [[gtkdialogDocTips8/#hn_8.4| Strikethrough text]]
5) [[gtkdialogDocTips8/#hn_8.5| Set font]]
6) [[gtkdialogDocTips8/#hn_8.6| Hyperlink]]
Deletions:
1) [[gtkdialogDocTips8/#hn_8.1 Some options for the <text> widget]]
2) [[gtkdialogDocTips8/#hn_8.2 Advanced text layout]]
3) [[gtkdialogDocTips8/#hn_8.3 Scroll text]]
4) [[gtkdialogDocTips8/#hn_8.4 Strikethrough text]]
5) [[gtkdialogDocTips8/#hn_8.5 Set font]]
6) [[gtkdialogDocTips8/#hn_8.6 Hyperlink]]


Revision [33327]

Edited on 2023-02-24 06:49:48 by zigbert
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
1) [[gtkdialogDocTips8/#hn_8.1 Some options for the <text> widget]]
2) [[gtkdialogDocTips8/#hn_8.2 Advanced text layout]]
3) [[gtkdialogDocTips8/#hn_8.3 Scroll text]]
4) [[gtkdialogDocTips8/#hn_8.4 Strikethrough text]]
5) [[gtkdialogDocTips8/#hn_8.5 Set font]]
6) [[gtkdialogDocTips8/#hn_8.6 Hyperlink]]
See [[https://github.com/puppylinux-woof-CE/gtkdialog/wiki/ reference guide]] for basic options.
===@@**#%[[gtkdialogDocTips7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.1|Next ❱❱❱]]#%**@@===
Deletions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[gtkdialog gtkdialog]] > [[gtkdialogDocTips Tips and Tricks]]
1) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.1 Some options for the <text> widget]]
2) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.2 Advanced text layout]]
3) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.3 Scroll text]]
4) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.4 Strikethrough text]]
5) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.5 Set font]]
6) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.6 Hyperlink]]
See [[http://01micko.com/reference/ reference guide]] for basic options.
@@**#%[[gtkdialogDocTips7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.1|Next ❱❱❱]]#%**@@


Revision [32911]

Edited on 2020-07-28 06:00:19 by zigbert
Additions:
1) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.1 Some options for the <text> widget]]
2) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.2 Advanced text layout]]
3) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.3 Scroll text]]
4) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.4 Strikethrough text]]
5) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.5 Set font]]
6) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_8.6 Hyperlink]]
Deletions:
1) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_1. Some options for the <text> widget]]
2) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_2. Advanced text layout]]
3) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_3. Scroll text]]
4) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_4. Strikethrough text]]
5) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_5. Set font]]
6) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_6. Hyperlink]]


Revision [32906]

Edited on 2020-07-28 05:40:05 by zigbert
Additions:
@@**#%[[gtkdialogDocTips7|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.1|Next ❱❱❱]]#%**@@


Revision [32892]

Edited on 2020-07-28 05:20:08 by zigbert
Additions:
==8.1==
==8.2==
==8.3==
==8.4==
==8.5==
==8.6==
Deletions:
==1.==
==2.==
==3.==
==4.==
==5.==
==6.==


Revision [32867]

Edited on 2020-07-24 19:47:39 by zigbert
Additions:
----
==Categories==
CategoryGtkdialog


Revision [32853]

Edited on 2020-07-24 03:53:25 by zigbert

No Differences

Revision [32851]

Edited on 2020-07-24 03:41:16 by zigbert
Additions:
====8. Text managing====
**INDEX**
1) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_1. Some options for the <text> widget]]
2) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_2. Advanced text layout]]
3) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_3. Scroll text]]
4) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_4. Strikethrough text]]
5) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_5. Set font]]
6) [[http://wikka.puppylinux.com/gtkdialogDocTips8/#hn_6. Hyperlink]]
==1.==
**Some options for the <text> widget**
See [[http://01micko.com/reference/ reference guide]] for basic options.
Here follows undocumented options.
Justify aligment to right (1), center (2), left (3).
~##<text justify="2">##
Angle the text
~##<text angle="45">##
Force one-line text
~##<text wrap="false">##
~##<text single-line-mode="true">##
Set underline pattern
~##<text label="Underline me with an useless pattern" pattern="""__ __ __ __ __ __ _"""></text>##
==2.==
**Advanced text layout**
__underline__, ##italic## and **Bold**.
~##<text use-markup="true"><label>"<u><i><b>test</b></i></u>"</label></text>##
Gtkdialog supports colors and size with the ##<span>## tag. The ##use-markup="true"## must be included.
~##<text use-markup="true"><label>"<span color='"'#789978'"'>test</span>"</label></text>##
Text size is set by the ##<big>## and ##<small>## tags. Repeat (up to 3 times) to increase value.
~##<text use-markup="true"><label>"<big><big><big>test</big></big></big>"</label></text>##
~##<text use-markup="true"><label>"<small><small><small>test</small></small></small>"</label></text>##
Vovchik has made an editor to test advanced text layout,
Check it out at [[http://www.murga-linux.com/puppy/viewtopic.php?t=40418]].
==3.==
**Scroll text**
This example shows scrolling text in a ##<text>## widget. This will work for other widgets as well.
export MSG="This is a test... I repeat: This is a test... "
export GTKBOX='
<vbox width-request="300">
<variable>MSG</variable>
<input>echo -en "${MSG:2}${MSG:0:2}"</input>
<timer milliseconds="true" interval="200" visible="false">
<action type="refresh">MSG</action>
</timer>
gtkdialog -p GTKBOX
==4.==
**Strikethrough text**
Strikethrough text is supported by the ##use-markup="true"## option for text widgets.
~##<text use-markup="true"><label>"<s>test</s>"</label></text>##
This example shows strikethrough on request
> /tmp/strikethrough
export DIALOG='
<window title="StrikeThrough" icon-name="gtk-strikethrough">
<vbox>
<edit wrap-mode="3">
<variable>EDIT</variable>
<default>write some text here</default>
<height>50</height>
</edit>
<edit file-monitor="true" auto-refresh="true" wrap-mode="3" editable="false">
<height>50</height>
<input file>/tmp/strikethrough</input>
</edit>
<hbox homogeneous="true">
<button>
<label>Strikethrough text</label>
<input file stock="gtk-ok"></input>
<action>`echo "$EDIT" | sed "s/./&\xCC\xB6/g" > /tmp/strikethrough`</action>
</button>
</hbox>
</vbox>
</window>'
gtkdialog -p DIALOG
==5.==
**Set font**
This is an example how to use other fonts even if gtkdialog hasn't an option to set this.
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="
<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
==6.==
**Hyperlink**
Hyperlink is clickable text, often pointing user to a web page.
<text selectable="true" use-markup="true">
<input>linkstyle "click here"</input>
<action signal="button-press-event">defaultbrowser '$LNK'</action>
</text>
Other solutions including ##<eventbox>## is discussed at [[http://murga-linux.com/puppy/viewtopic.php?t=106458]]
Deletions:
====7. Advanced Syntax - make your code readable====
**Comments in your code**
Gtkdialog doesn't support comments in its xml code. But if we convert all comments before execution, it works. The reason why I use double hash (""##"") for my comments, is because colors in a ##<span>## tag might be defined as ##red## or ###FF0000##. The latter would be removed by using a single hash.
XML='
<vbox> ##this is how to comment your xml code.
<text height-request="50"> ##force the text to take more space.
<label>Hello</label>
<hbox> ##hbox to align button to the right.
<button ok></button> ##button ok is fetched from the gtk stock.
</hbox>
export GUI="`echo "$XML" | sed -e 's/##.*//'`"
gtkdialog -p GUI
**Include code if...**
It is possible to build the gtkdialog out of many small pieces. Every piece is a variable and are put together when exporting the gtkdialog code. It is easy to think that a button should have different label depending on "//this or that//". Or like in the following example, - include a button if file/app/... exists. Instead of defining all these pieces before the actual gtkdialog code, it is much more human readable if you define all 'inside' the gtkdialog code.
script='
<hbox>
<label>Yes button added if file /root/testfile exists</label>
</text>'
[ -f /root/testfile ;then script=${script}'<button yes></button>'
script=${script}'
<button no>
</button>
</hbox>
export SCRIPT="$script"
gtkdialog --program=SCRIPT


Revision [32850]

The oldest known version of this page was created on 2020-07-24 03:13:49 by zigbert
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki