Revision history for gtkdialogDocTips9.4


Revision [33334]

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


Revision [32940]

Edited on 2020-07-31 03:21:41 by zigbert
Additions:
**Static**
Fixed size.
<text width-chars="40" height-request="120"><label>" "</label></text>
**Dynamic**
Align one button to the left, another to the right. Empty gap will fill the rest.
Deletions:
Static:
~##<text width-chars="40" height-request="120"><label>" "</label></text>##
Dynamic:
(align one button to the left, another to the right)


Revision [32934]

Edited on 2020-07-31 03:17:11 by zigbert
Additions:
====9.4 Insert empty gap====
Deletions:
==9.4 Insert empty gap==


Revision [32925]

Edited on 2020-07-31 02:47:12 by zigbert
Additions:
==9.4 Insert empty gap==
@@**#%[[gtkdialogDocTips9.3|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.5|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.
<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**
Gtkdialog tends to align objects to the right side of the window. Exceptions are radiobuttons and checkboxes which are aligned to the left. It is easy to center whatever object in your gui. Here's some alignment explanation:
- ##<hbox><button>...</button></hbox>## will place button to the right.
- ##<button>...</button>## and button will fill whole line.
- ##<hbox homogeneous=true><button>...</button></hbox>## will place button in horizontal center.
- ##<hbox homogeneous=true><vbox homogeneous=true><button>...</button></vbox></hbox>## will place button in center both vertical and horizontal.
- ##<hbox><text xalign="0">...</text></hbox>## will place text at left. xalign/yalign may hold 0, 1 or 2 for left, right or center. xalign/yalign works for other widgets as well. For buttons they describe placement of label rather than button itself.
Using vertical rows can be troublesome, because often, the label defines the width of the objects. This leads to different width and it all looks crappy. You can override this by the attribute ##<vbox width-request="x">...</vbox>##, where x represent the number of pixels for the width of the row. There is also a ##height-request## attribute.
==4.==
**Insert empty gap**
==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 [32924]

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