Remove im_str! usage from examples in docs

This commit is contained in:
Jiří Sejkora 2022-02-27 05:30:51 +01:00 committed by Jonathan Spira
parent 37926397fa
commit 30f8f04dcf
4 changed files with 12 additions and 15 deletions

View File

@ -426,7 +426,7 @@ impl<'ui> DrawListMut<'ui> {
/// # use imgui::*; /// # use imgui::*;
/// fn custom_button(ui: &Ui, img_id: TextureId) { /// fn custom_button(ui: &Ui, img_id: TextureId) {
/// // Invisible button is good widget to customise with image /// // 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 /// // Get draw list and draw image over invisible button
/// let draw_list = ui.get_window_draw_list(); /// let draw_list = ui.get_window_draw_list();

View File

@ -609,7 +609,7 @@ impl Ui {
/// ui.text("Hover over me"); /// ui.text("Hover over me");
/// if ui.is_item_hovered() { /// if ui.is_item_hovered() {
/// ui.tooltip(|| { /// 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!");
/// }); /// });
/// } /// }
/// } /// }
@ -676,7 +676,7 @@ impl Ui {
/// fn user_interface(ui: &Ui) { /// fn user_interface(ui: &Ui) {
/// let disable_buttons = true; /// let disable_buttons = true;
/// let _d = ui.begin_disabled(disable_buttons); /// let _d = ui.begin_disabled(disable_buttons);
/// ui.button(im_str!("Dangerous button")); /// ui.button("Dangerous button");
/// } /// }
/// ``` /// ```
@ -703,7 +703,7 @@ impl Ui {
/// fn user_interface(ui: &Ui) { /// fn user_interface(ui: &Ui) {
/// let safe_mode = true; /// let safe_mode = true;
/// ui.disabled(safe_mode, || { /// ui.disabled(safe_mode, || {
/// ui.button(im_str!("Dangerous button")); /// ui.button("Dangerous button");
/// }); /// });
/// } /// }
/// ``` /// ```

View File

@ -196,8 +196,7 @@ where
/// Constructs a new vertical slider builder with the given size and range. /// Constructs a new vertical slider builder with the given size and range.
/// ///
/// ```rust /// ```rust
/// # use imgui::im_str; /// imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
/// imgui::VerticalSlider::new(im_str!("Example"), [20.0, 20.0], i8::MIN, i8::MAX)
/// .range(4, 8) /// .range(4, 8)
/// // Remember to call .build(&ui) /// // Remember to call .build(&ui)
/// ; /// ;
@ -227,8 +226,7 @@ where
/// Sets the range for the vertical slider. /// Sets the range for the vertical slider.
/// ///
/// ```rust /// ```rust
/// # use imgui::im_str; /// imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
/// imgui::VerticalSlider::new(im_str!("Example"), [20.0, 20.0], i8::MIN, i8::MAX)
/// .range(4, 8) /// .range(4, 8)
/// // Remember to call .build(&ui) /// // Remember to call .build(&ui)
/// ; /// ;
@ -320,8 +318,7 @@ where
{ {
/// Sets the range in degrees (inclusive) /// Sets the range in degrees (inclusive)
/// ```rust /// ```rust
/// # use imgui::im_str; /// imgui::AngleSlider::new("Example")
/// imgui::AngleSlider::new(im_str!("Example"))
/// .range_degrees(-20.0, 20.0) /// .range_degrees(-20.0, 20.0)
/// // Remember to call .build(&ui) /// // Remember to call .build(&ui)
/// ; /// ;

View File

@ -6,12 +6,12 @@
//! # let ui = ctx.frame(); //! # let ui = ctx.frame();
//! //!
//! // During UI construction //! // During UI construction
//! TabBar::new(im_str!("tabbar")).build(&ui, || { //! TabBar::new("tabbar").build(&ui, || {
//! TabItem::new(im_str!("a tab")).build(&ui, || { //! TabItem::new("a tab").build(&ui, || {
//! ui.text(im_str!("tab content 1")); //! ui.text("tab content 1");
//! }); //! });
//! TabItem::new(im_str!("2tab")).build(&ui, || { //! TabItem::new("2tab").build(&ui, || {
//! ui.text(im_str!("tab content 2")); //! ui.text("tab content 2");
//! }); //! });
//! }); //! });
//! ``` //! ```