Skip to main content
June 28, 2015
Question

ListBox´s items icon not being drawn

  • June 28, 2015
  • 3 replies
  • 1043 views

Hello there

I´ve facing a problem with the listbox´s items icon. On Mac they don´t get drawn as you can see in the animation below. It is very strange if you keep clicking the button you´ll see that some get drawn other doesn´t.

if you see the animation above when I make active the listbox the icons get drawn. I´ve tried hard to fix this problem trying to force an update on the listbox but nothing seems to help.

Here is the sample test code as well as the icon just put it in the desktop.

    var img = Folder.desktop.fsName+"/icon.png";

    var items = ["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"];

   

    var win = new Window("dialog","Tester",[0,0,300,400]);

   

        var lb = win.add("listbox",[0,0,300,370],[]);

   

        var btn = win.add("button",[0,370,300,390],"Update List");

        btn.onClick = function(){

                                lb.removeAll();

                                for(i = 0; i<items.length; i++){

                                    var item = lb.add("item",items);

                                    item.image = img;

                                }

                             }

   

   

    win.center();

    win.show();

By the way this only happens on a mac (AE CC ,2014, 2015), on pc it works fine.

Any help would be really appreciated.

Thanks

This topic has been closed for replies.

3 replies

Inspiring
April 20, 2016

Hey guys,

I have also been experiencing this issue to my total frustration and could not find a solution AT ALL.  But, taking a little of what you described here and playing around, I think I may have found a solution.  I didn't love having to call win.update() after every add for the potential performance hit (minimal yes, but amplified for longer listboxes).  But it appeared necessary as every call would refresh the the most recent addition (and for some reason calling win.update() AFTER all the adds happened didn't do it).

After playing around with some other things, I found that if I set the listbox.active = false, did whatever I needed to do, then called win.update() a single time at the end and set listbox.active = true, voila!  It worked!  This essentially forced the window to refresh and then re-draw as the focus was set to the listbox.  AND you don't take the performance hit (again, minimal) of calling win.update() a bunch of times.  And you need to initially set the listbox.active = false or else it doesn't force the re-draw on subsequent clicks of the button.

I hate jumping through hoops and as frustrating as it is, I can totally understand why Adobe hasn't kept up with improvements to the ScriptUI package.  It seems like CEP is the way of the future and piggybacking on HTML5 and CSS must be much easier than keeping an internal javascript UI library up to date.

Inspiring
July 6, 2015

This is a bug. I have reported it and had it confirmed. Alas, two versions on (I reported it in CC, when there were some big ScriptUI changes), this is still an issue with Mac ScriptUI list boxes. It's been somewhat of a pain to be sure!

June 29, 2015

Hi

Anyone having the same problem?

I still can´t fix it.

Thanks

Legend
June 29, 2015

I've had issues with listbox UI elements updating before in the past. Resizing columns if any or the panel containing the listbox usually updates it correctly, unfortunately this issue has been around for a little while. You might be able to call a resize on the listbox as part of the data loop to force it to update maybe.

I would still file a bug report though. Adobe - Feature Request/Bug Report Form

June 30, 2015

Hi David

Have you tested the code? Did you get the same issues as in the animation?

I´ve tried every trick to force it to upade but nothing seems to work.

Thanks a lot for you time.