Hidden scrollbar doesn't resize with window

A window with a flex layout widget has a horizontal scrollbar at the bottom. When the window is resized the scrollbar properly adjusts to the new size. The problem occurs when the scrollbar is hidden and then the window is resized. When the scrollbar is re-shown it appears in it's prior position. When the window is resized again the scrollbar will then snap to the new position and work properly. The following image shows the window after the scrollbar is re-shown. The scrollbar should be at the bottom of the window and have the new window width:

ScrollHide2

The following code can demonstrate the behavior:

// Testing the fltk scrollbar with hiding and resizing
// Be sure to have the following line in Cargo.toml after [dependencies]:
// fltk = { version = "1.4.15", features = ["fltk-bundled"] }
use fltk::{prelude::*, window::Window, enums::*, *};

fn main() {
    let app = app::App::default();
    let mut wind = Window::default()
        .with_size(400, 100)
        .with_label("Scrollbar hide test");
    wind.make_resizable(true);

    let mut col = group::Flex::default_fill().column();
    col.set_pad(0);

    let mut mbar: menu::MenuBar = menu::MenuBar::default();
    col.fixed(&mbar, 25);
    mbar.add(
        "&Options/Hide scrollbar",
        Shortcut::None,
        menu::MenuFlag::Toggle,
        menu_cb,
    );

    let mut _text = frame::Frame::default().with_label("Some text");

    let mut _bar = valuator::Scrollbar::default()
        .with_type(valuator::ScrollbarType::Horizontal);
    col.fixed(&_bar, 20);

    col.end();

    wind.end();
    wind.show();

    app.run().unwrap();
}

fn menu_cb(mbar: &mut impl MenuExt) {
    if let Ok(mpath) = mbar.item_pathname(None) {
        if mpath.as_str() == "&Options/Hide scrollbar" {
            let state = mbar.find_item("&Options/Hide scrollbar").unwrap().value();
            let mut scroll = mbar.parent().unwrap().child(2).unwrap();
            if state { scroll.hide(); }
            else     { scroll.show(); }
        }
    }
}

Take these steps to show the behavior:

  1. Start the program.
  2. Click "Options", then "Hide scrollbar". The scrollbar will disappear, but "Some text" doesn't lower to the middle.
  3. With mouse, drag the lower the window's lower-right corner down and to the right just a bit. "Some text" suddenly re-centers and then stays in the middle.
  4. Click "Options", then "Hide scrollbar" (thereby toggling it off). The scrollbar appears in its prior position, and "Some text" stays in the middle.
  5. Drag the window's lower-right corner again. The scrollbar will suddenly jump to its proper position and "Some text" will reposition itself properly.

Remedies? Is there a command I can issue so that everything is repositioned as if the window was resized, but instead the the scrollbar was hiddened/shown? Thanks in advance for any help.

Here's the window when the program starts (posting both images at once was not allowed):

ScrollHide1

I asked the same question on the github site and Mohammed Alyousef was quick to reply. (Thanks Mohammed!) See the discussion at Hidden scrollbar doesn't resize with window · fltk-rs/fltk-rs · Discussion #1592 · GitHub
I will close this issue.

Hmmm... Don't see how to close this issue...
Might have to wait 3 months to let it close automatically...

You can just mark your previous reply as the solution by click the check box at the bottom. This lets people know it is solved, but you also want it closed to more posts, just say so and I'll close it for you.