[sugar] Applications without icons

Dan Williams dcbw
Fri Aug 25 16:54:25 EDT 2006


On Fri, 2006-08-25 at 16:28 -0300, Gonzalo Odiard wrote:
> Hello:
> If i edit terminal.activity and add the line 
> show_launcher = yes
> sugar don't start because IconItem.py not check name == None

I've fixed this in git.  If the activity does not specify the correct
icon, it will not show up in the activity icon area on the frame, and
you will get a nice printed message in the logs about the activity
missing an icon.

If you want to set an icon, you need to add the "icon = <name>" tag in
the .activity file, _without_ the extension, since the icon is assumed
to be an SVG file.  You'll also need to have some specific classes in
the CSS for the SVG file, otherwise it won't show correctly in sugar.

Specifically:

<defs>
  <style type="text/css">
    .shape-and-fill {fill: green; stroke: red}
    .fill {fill: green; stroke: green;}
    .shape {fill: red; stroke: red;}
  </style>
</defs>

Your SVG shape objects need to be subclasses of one of these three
classes.

Dan


> I have tried to resolv this, but without luck.
> If i do:
>         def _create_icon(self, name, color, size):
>                 print name
>                 if name == None:
>                         img = gtk.image_new_from_stock
> (gtk.STOCK_MISSING_IMAGE,size)
>                         return img.get_pixbuf()
> have a error but i dont know why. 
> Outside of sugar this litle test work ok:
> #!/usr/bin/env python
> import gtk
> w = gtk.Window()
> w.connect("destroy", gtk.main_quit)
> im = gtk.image_new_from_stock(gtk.STOCK_MISSING_IMAGE,2)
> w.add(im)
> w.show_all()
> gtk.main()
> 
> 
> Another test i do is 
>         def _create_icon(self, name, color, size):
>                 print name
>                 if name == None:
>                         name = "stock-missing-image"
> don work too.
> I am doing anithing really stupid or is a problem with the sugar
> enviroment?
> Gonzalo
> 
> 
> 
> 
> _______________________________________________
> Sugar mailing list
> Sugar at laptop.org
> http://mailman.laptop.org/mailman/listinfo/sugar



More information about the Sugar-devel mailing list