HomePage > Software Index > Development > gtkdialog > 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.

<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 "Undo", 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.


Categories
CategoryGtkdialog
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki