Revision history for gtkdialogDocTips9.3


Revision [33333]

Last edited on 2023-02-24 06:55:07 by zigbert
Additions:
[[HomePage]] > [[SoftwareIndex|Software Index]] > [[SoftwareDevelopment|Development]] > [[gtkdialog|gtkdialog]] > [[gtkdialogDocTips|Tips and Tricks]]
===@@**#%[[gtkdialogDocTips9.2|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.4|Next ❱❱❱]]#%**@@===
Deletions:
[[HomePage]] > [[SoftwareIndex Software Index]] > [[SoftwareDevelopment Development]] > [[gtkdialog gtkdialog]] > [[gtkdialogDocTips Tips and Tricks]]
@@**#%[[gtkdialogDocTips9.2|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.4|Next ❱❱❱]]#%**@@


Revision [32938]

Edited on 2020-07-31 03:18:58 by zigbert

No Differences

Revision [32933]

Edited on 2020-07-31 03:16:56 by zigbert
Additions:
====9.3 Understand the alignment====
Deletions:
==9.3 Understand the alignment==


Revision [32923]

Edited on 2020-07-31 02:46:10 by zigbert
Additions:
==9.3 Understand the alignment==
@@**#%[[gtkdialogDocTips9.2|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.4|Next ❱❱❱]]#%**@@
----
==Categories==
CategoryGtkdialog
Deletions:
====9. Tips and Tricks====
==1.==
**How to change the gui without restarting the app**
Recent Gtkdialog allows to hide/show widgets, To hide many widgets at once, you can hide a ##<hbox>## or ##<vbox>##. This will hide all widgets inside the box.
Another approach is to use the notebook attributes ##<notebook show-tabs="false" show-border="false">##. Using several tabs in a notebook with hidden header, we can simulate a gui re-render. The only thing that is happening is that we switch tab, but since the user can't see those, he will be fooled...
More info at [[http://www.murga-linux.com/puppy/viewtopic.php?p=553833#553833]].
==2.==
**Control the icon/label of menuitems**
If you have met problems to show a certain icon and at the same time give it an unique label, this will illustrate how it is recommended to be implemented for the benefit of anyone and everyone.
%%(language-ref)
<menuitem stock="gtk-undo" label="'$LOC118'" accel-key="0x07a" accel-mods="4">
<action>. '$APPDIR'/func -undo</action>
<action>refresh:PLAYLIST</action>
</menuitem>'
%%
Doing it this way makes GTK+ deal with the left-to-right and right-to-left internationalisation of the icons if applicable. You might think this won't work because GTK+ will make a stock label "__U__ndo", and it will. But, straight afterwards it will update the label with ##$LOC118##. Because it initially was a stock label, ##use-underline## is automatically set to true, and you can use underscores in your custom text.
==3.==
**Understand the alignment**
==4.==
**Insert empty gap**
Static:
~##<text width-chars="40" height-request="120"><label>" "</label></text>##
Dynamic:
(align one button to the left, another to the right)
%%(language-ref)
<hbox space-expand="false" space-fill="false">
<button yes></button>
<hbox space-expand="true" space-fill="true"><text><label>" "</label></text></hbox>
<button no></button>
</hbox>
%%
==5.==
**Window header icon**
You can add your own icon (symlinks also work) if you place it in a gtk-theme directory structure as ##/usr/share/icons/hicolor/##. ie. ##/usr/share/icons/hicolor/48x48/apps/games48.png##
Now, run this command in the terminal to refresh the icon cache;
~##gtk-update-icon-cache -f -i /usr/share/icons/hicolor##
Your gtkdialog code would look like this;
~##<window title="A GTKDialog" icon-name="games48" resizable="false" decorated="true">##


Revision [32922]

The oldest known version of this page was created on 2020-07-31 02:45:25 by zigbert
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki