Wiki source for gtkdialogDocTips9.2


Show raw source

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

====9.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.

===@@**#%[[gtkdialogDocTips9.1|❰❰❰ Previous]]#% #%[[gtkdialogDocTips|Index]]#% #%[[gtkdialogDocTips9.3|Next ❱❱❱]]#%**@@===
----
==Categories==
CategoryGtkdialog
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki