Skip to main content
deckarduk
Inspiring
August 17, 2018
Answered

ScriptUI question re listbox headers color

  • August 17, 2018
  • 1 reply
  • 770 views

Hi there,

Working forward from the example below, taken from the ScriptUI documentation, I've created a dynamically generated dialog in InDesign CC2018.

The dialog works fine and displays the information as required.

I've tried a few things but as yet I've not been able to change the background colour of the header row.s there any way i can do this with a listbox?

I've found a few code examples using other methods, do I need to change the way the dialog is created to achieve this?

Thanks in advance.

var w = new Window ("dialog");

var myList = w.add ("listbox", undefined, " ",

{numberOfColumns: 3, showHeaders: true,

columnTitles: ["English", "French", "Dutch"]});

with (myList.add ("item", "One"))

{

subItems[0].text = "Un";

subItems[1].text = "Een";

}

with (myList.add ("item", "Two"))

{

subItems[0].text = "Deux";

subItems[1].text = "Twee";

}

with (myList.add ("item", "Three"))

{

subItems[0].text = "Trois";

subItems[1].text = "Drie";

}

w.show ();

This topic has been closed for replies.
Correct answer Peter Kahrel

I don't think you can change the appearance of header cells when you use 'columnTitles'. You can do that only if you define your own headers (which will then therefore be plain rows, not real header rows). The documentation you mentioned could probably do a better job of making that clear (on pp. 38 and 39).

P.

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
August 17, 2018

I don't think you can change the appearance of header cells when you use 'columnTitles'. You can do that only if you define your own headers (which will then therefore be plain rows, not real header rows). The documentation you mentioned could probably do a better job of making that clear (on pp. 38 and 39).

P.

deckarduk
deckardukAuthor
Inspiring
August 20, 2018

Hi Peter,

Thanks for the help and confirmation.

I'd seen an example with it being a non column header row and a background colour applied.

Just wondered if I'd missed something.

I'll have another look at pages 38 & 39 of the documentation.

Thanks again.

Peter Kahrel
Community Expert
Community Expert
August 20, 2018

On p. 40 is an example of what you were after: a non-column header row and a background colour applied.

P.