diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-08 16:42:57 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-08 16:42:57 -0500 |
| commit | 3aa59d4ab9d1217fa47c4b1b265fd435547ed62f (patch) | |
| tree | bdffbdb57872231213018a6e1df732bcc0687067 /combobox.go | |
| parent | d9b0bd3c700f7c559757834f7463410cfafd6c1e (diff) | |
Added Combobox/Listbox.Len() and its GTK+ implementation.
Diffstat (limited to 'combobox.go')
| -rw-r--r-- | combobox.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/combobox.go b/combobox.go index cadce35..fbeb365 100644 --- a/combobox.go +++ b/combobox.go @@ -102,6 +102,19 @@ func (c *Combobox) SelectedIndex() int { return -1 } +// Len returns the number of items in the Combobox. +// +// On platforms for which this function may return an error, it panics if one is returned. +func (c *Combobox) Len() int { + c.lock.Lock() + defer c.lock.Unlock() + + if c.created { + return c.sysData.len() + } + return len(c.initItems) +} + func (c *Combobox) make(window *sysData) (err error) { c.lock.Lock() defer c.lock.Unlock() |
