Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Python Add-In Combobox will not populate

$
0
0
Hi all,

I'm trying to create a simple add-in combo box using the new python interface. I have read the ESRI help on creating an add in project (http://resources.arcgis.com/en/help/...0000022000000/) as well as creating an add in combo box (http://resources.arcgis.com/en/help/...0000028000000/).

I am having trouble populating the combo box from a list of values that I pass to the __init__ class within the install file.

Here is my entire script:


Code:

import arcpy
import pythonaddins

class ComboBoxClass1(object):
    """Implementation for Project Map_addin.combobox (ComboBox)"""
    def __init__(self):
        self.items = ["Project 1", "Project 2", "Project 3", "Project 4"]
        self.editable = False
        self.enabled = True
        self.dropdownWidth = 'WWWWWWWWW'
        self.width = 'WWWWWWWWWWWW'
        self.refresh()

    def onSelChange(self, selection):
        pass
    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
        pass
    def onEnter(self):
        pass
    def refresh(self):
        pass

I have tried a number of different things to get the drop-down to populate. None have worked.

Any suggestions would be great

Viewing all articles
Browse latest Browse all 2485

Trending Articles