Skip to content

Commit

Permalink
Fix up running of begin_combo doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
dbr committed Feb 10, 2022
1 parent 6dfa0a9 commit 69fb34f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion imgui/src/widget/combo_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,12 @@ impl Ui {
/// # Example
///
/// ```rust,no_run
/// # let mut ctx = imgui::Context::create();
/// # {let ui = ctx.frame();
///
/// let items = vec!["Example 1", "Example 2"];
/// let mut selected = &items[0];
/// if let Some(cb) = ui.begin_combo("example_combo") {
/// if let Some(cb) = ui.begin_combo("example_combo", format!("Selected item: {}", selected)) {
/// for cur in &items {
/// if selected == cur {
/// // Auto-scroll to selected item
Expand All @@ -223,6 +226,7 @@ impl Ui {
/// }
/// }
/// }
/// # };
/// ```
#[must_use]
#[doc(alias = "BeginCombo")]
Expand Down

0 comments on commit 69fb34f

Please sign in to comment.