Skip to content

Commit d682cfe

Browse files
authored
Merge pull request #50 from barzamin/39-combobox-get-selected
implement Combobox::selected()
2 parents 13fd812 + 5b5920f commit d682cfe

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
99
### Added
1010

1111
- `ProgressBar` control for tracking the completion of a task
12+
- `Combobox::selected()` method to retrieve the currently selected index of the combobox
1213

1314
### Changed
1415

iui/src/controls/entry.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ impl Combobox {
227227
}
228228
}
229229

230+
/// Returns the index of the currently selected option.
231+
pub fn selected(&self, _ctx: &UI) -> i32 {
232+
unsafe { ui_sys::uiComboboxSelected(self.uiCombobox) }
233+
}
234+
230235
pub fn set_selected(&mut self, _ctx: &UI, value: i32) {
231236
unsafe { ui_sys::uiComboboxSetSelected(self.uiCombobox, value) }
232237
}

0 commit comments

Comments
 (0)