Skip to content

Commit

Permalink
Remove im_str! usage from examples in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sejsel authored and sanbox-irl committed Feb 28, 2022
1 parent 3792639 commit 30f8f04
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion imgui/src/draw_list.rs
Expand Up @@ -426,7 +426,7 @@ impl<'ui> DrawListMut<'ui> {
/// # use imgui::*;
/// fn custom_button(ui: &Ui, img_id: TextureId) {
/// // Invisible button is good widget to customise with image
/// ui.invisible_button(im_str!("custom_button"), [100.0, 20.0]);
/// ui.invisible_button("custom_button", [100.0, 20.0]);
///
/// // Get draw list and draw image over invisible button
/// let draw_list = ui.get_window_draw_list();
Expand Down
6 changes: 3 additions & 3 deletions imgui/src/lib.rs
Expand Up @@ -609,7 +609,7 @@ impl Ui {
/// ui.text("Hover over me");
/// if ui.is_item_hovered() {
/// ui.tooltip(|| {
/// ui.text_colored([1.0, 0.0, 0.0, 1.0], im_str!("I'm red!"));
/// ui.text_colored([1.0, 0.0, 0.0, 1.0], "I'm red!");
/// });
/// }
/// }
Expand Down Expand Up @@ -676,7 +676,7 @@ impl Ui {
/// fn user_interface(ui: &Ui) {
/// let disable_buttons = true;
/// let _d = ui.begin_disabled(disable_buttons);
/// ui.button(im_str!("Dangerous button"));
/// ui.button("Dangerous button");
/// }
/// ```

Expand All @@ -703,7 +703,7 @@ impl Ui {
/// fn user_interface(ui: &Ui) {
/// let safe_mode = true;
/// ui.disabled(safe_mode, || {
/// ui.button(im_str!("Dangerous button"));
/// ui.button("Dangerous button");
/// });
/// }
/// ```
Expand Down
9 changes: 3 additions & 6 deletions imgui/src/widget/slider.rs
Expand Up @@ -196,8 +196,7 @@ where
/// Constructs a new vertical slider builder with the given size and range.
///
/// ```rust
/// # use imgui::im_str;
/// imgui::VerticalSlider::new(im_str!("Example"), [20.0, 20.0], i8::MIN, i8::MAX)
/// imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
/// .range(4, 8)
/// // Remember to call .build(&ui)
/// ;
Expand Down Expand Up @@ -227,8 +226,7 @@ where
/// Sets the range for the vertical slider.
///
/// ```rust
/// # use imgui::im_str;
/// imgui::VerticalSlider::new(im_str!("Example"), [20.0, 20.0], i8::MIN, i8::MAX)
/// imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
/// .range(4, 8)
/// // Remember to call .build(&ui)
/// ;
Expand Down Expand Up @@ -320,8 +318,7 @@ where
{
/// Sets the range in degrees (inclusive)
/// ```rust
/// # use imgui::im_str;
/// imgui::AngleSlider::new(im_str!("Example"))
/// imgui::AngleSlider::new("Example")
/// .range_degrees(-20.0, 20.0)
/// // Remember to call .build(&ui)
/// ;
Expand Down
10 changes: 5 additions & 5 deletions imgui/src/widget/tab.rs
Expand Up @@ -6,12 +6,12 @@
//! # let ui = ctx.frame();
//!
//! // During UI construction
//! TabBar::new(im_str!("tabbar")).build(&ui, || {
//! TabItem::new(im_str!("a tab")).build(&ui, || {
//! ui.text(im_str!("tab content 1"));
//! TabBar::new("tabbar").build(&ui, || {
//! TabItem::new("a tab").build(&ui, || {
//! ui.text("tab content 1");
//! });
//! TabItem::new(im_str!("2tab")).build(&ui, || {
//! ui.text(im_str!("tab content 2"));
//! TabItem::new("2tab").build(&ui, || {
//! ui.text("tab content 2");
//! });
//! });
//! ```
Expand Down

0 comments on commit 30f8f04

Please sign in to comment.