Development Team/Almanac/sugar.graphics.icon: Difference between revisions
m moved Walter is a wanker 12/Almanac/sugar.graphics.icon to Development Team/Almanac/sugar.graphics.icon over redirect: revert |
|||
| (10 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
= Class: Icon = | === Where do I put images for icons so that they can easily be referenced in my code? === | ||
In your main activity bundle directory, you should have a subdirectory called 'icons'. In this directory, place any image files (usually in svg) format and then you can refer to those images by using the filename without the extension. For example, the activity containing the files below could refer to the following images for use with icons: 'edit-custom', 'ok-button', 'next-page' and 'prev-page'. | |||
<pre> | |||
Annotate.activity | |||
|-- activity | |||
| |-- activity-annotate.svg | |||
| `-- activity.info | |||
|-- icons | |||
| |-- edit-custom.svg | |||
| |-- next-page.svg | |||
| |-- ok-button.svg | |||
| `-- prev-page.svg | |||
</pre> | |||
= Class: Icon ([http://www.pygtk.org/docs/pygtk/ gtk.Image])= | |||
=== How do I create a button with a specific icon image? === | === How do I create a button with a specific icon image? === | ||
| Line 17: | Line 34: | ||
</pre> | </pre> | ||