PDA

View Full Version : Populating ComboBox Plugin



octane6228
06-09-2005, 01:46 PM
Hi Guys...I'm trying to populate a combobox based on how many images are in a directory....

--Populate a table with jpg files from the Image directory and count their numbers
tbl_path = File.Find("AutoPlay\\Images\\PowerPoint\\", "*.jpg", false, false, nil, nil);
img_nbr = Table.Count(tbl_path);

ComboBox.SetUpdate("Plugin2", false);
for i = 1, img_nbr do
ComboBox.AddItem ("Plugin2", "Slide "..img_nbr,"");
end
ComboBox.SetUpdate("Plugin2", true);



In this case I have 24 images in the directory...trouble is it just repeats slide 24.....24 times in the combo box....I want it to update the combo box with slide1 to slide24 ?

Any ideas on what I'm doing wrong?

Thanks a lot for any help

Octane

Dermot
06-09-2005, 02:41 PM
Try this.


ComboBox.SetUpdate("Plugin2", false);
for i = 1, img_nbr do
ComboBox.AddItem ("Plugin2", "Slide "..i,"");
end
ComboBox.SetUpdate("Plugin2", true);

Dermot

octane6228
06-09-2005, 04:34 PM
Thanks Dermot! It worked great!