Icon

15 views
Skip to first unread message

Adrian Klaver

unread,
Mar 21, 2013, 4:04:44 PM3/21/13
to project...@googlegroups.com
How does one go about using a custom icon with an action?
I created a 32x32 PNG icon from a picture and pointed to it in Icon().
When I run the application nothing shows up and I get no error, so I am
not sure where to go from here?

Thanks,
--
Adrian Klaver
adrian...@gmail.com

Jeroen Dierckx

unread,
Mar 22, 2013, 8:33:20 AM3/22/13
to project-camelot
Hello Adrian,

Have you assigned it to the action member "icon"?
Is the image in the "art" directory?

Try using an icon that is shipped with Camelot first, something like:

class MyAction( Action ):

verbose_name = 'My Action'
icon = Icon( 'tango/16x16/mimetypes/x-office-document.png' )

Do you see this one?

Best regards,
Jeroen
> --
> --
> You received this message because you are subscribed to the "Project
> Camelot" group.
> Visit www.python-camelot.com for more information
>
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to
> project-camel...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/project-camelot?hl=en
>
> --- You received this message because you are subscribed to the Google
> Groups "Project Camelot" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to project-camel...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Adrian Klaver

unread,
Mar 22, 2013, 9:42:39 AM3/22/13
to project...@googlegroups.com, Jeroen Dierckx
On 03/22/2013 05:33 AM, Jeroen Dierckx wrote:
> Hello Adrian,
>
> Have you assigned it to the action member "icon"?
> Is the image in the "art" directory?
>
> Try using an icon that is shipped with Camelot first, something like:
>
> class MyAction( Action ):
>
> verbose_name = 'My Action'
> icon = Icon( 'tango/16x16/mimetypes/x-office-document.png' )
>
> Do you see this one?

I called it as shown below:

new_plant_action = OpenNewView(self.get_related_admin(Plant))
new_plant_action.verbose_name = "New Plant"
new_plant_action.icon = Icon('tango/32x32/mimetypes/plant.png')

and yes the stock icons worked.

Hmmm, on a different machine it works. Both machines have the same
version of OS, OpenSUSE 12.2 and I thought the same versions of
libraries. Will have to investigate further.

>
> Best regards,
> Jeroen
>
>


--
Adrian Klaver
adrian...@gmail.com

Adrian Klaver

unread,
Mar 22, 2013, 7:36:25 PM3/22/13
to project...@googlegroups.com, Jeroen Dierckx
On 03/22/2013 06:40 AM, Adrian Klaver wrote:
> On 03/22/2013 05:33 AM, Jeroen Dierckx wrote:
>> Hello Adrian,
>>
>> Have you assigned it to the action member "icon"?
>> Is the image in the "art" directory?
>>
>> Try using an icon that is shipped with Camelot first, something like:
>>
>> class MyAction( Action ):
>>
>> verbose_name = 'My Action'
>> icon = Icon( 'tango/16x16/mimetypes/x-office-document.png' )
>>
>> Do you see this one?
>
> I called it as shown below:
>
> new_plant_action = OpenNewView(self.get_related_admin(Plant))
> new_plant_action.verbose_name = "New Plant"
> new_plant_action.icon = Icon('tango/32x32/mimetypes/plant.png')
>
> and yes the stock icons worked.
>
> Hmmm, on a different machine it works. Both machines have the same
> version of OS, OpenSUSE 12.2 and I thought the same versions of
> libraries. Will have to investigate further

Figured it out. On the machine where I was not seeing the icon I had an
old installation of Camelot that was on the PYTHONPATH before the one I
thought I was using. Removing the older version cured the issue.
Reply all
Reply to author
Forward
0 new messages