From: Edward K. Ream <[email protected]>
 To: leo-editor <[email protected]> 
 Sent: Friday, January 29, 2016 9:08 AM
 Subject: Code academy: icons
   
During our conference call, someone asked whether nodes may have more than one 
icon.  Indeed they can.

For example, running this script will insert three icons. Running the script 
again will insert three more.  You can delete the icons using the 
delete-node-icons command. I'm having trouble deleting icons programmatically.  
I'm investigating.


c.editCommands.setIconList(p, [])c.redraw()
If you don't want to delete them all:icons = c.editCommands.getIconList(p)icons 
= [i for i in icons if <condition to retain>]c.editCommands.setIconList(p, 
icons)

also, add a True param. at end of setIconList call to mark node dirty (changed, 
save required) if desired.
Cheers -Terry


table = (
    'edittrash.png',
    'connect_no.png',
    'error.png',
)
for icon in table:
    fn = g.os_path_finalize_join(g.app.loadDir,
        '..', 'Icons', 'Tango', '16x16', 'status', icon)
    if g.os_path_exists(fn):
        c.editCommands.insertIconFromFile(path=fn)

Edward
-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


   

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to