Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parent not updating dimension when child forces parent to grow #2774

Open
lokxii opened this issue Apr 8, 2024 · 1 comment
Open

parent not updating dimension when child forces parent to grow #2774

lokxii opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lokxii
Copy link

lokxii commented Apr 8, 2024

Consider the following code

#include <iostream>
#include <notcurses/notcurses.h>

int main() {
    notcurses* nc = NULL;
    notcurses_options opt = {
        .loglevel = NCLOGLEVEL_TRACE,
        .flags = NCOPTION_NO_QUIT_SIGHANDLERS | NCOPTION_SUPPRESS_BANNERS
    };
    if ((nc = notcurses_init(&opt, NULL)) == NULL) {
        exit(EXIT_FAILURE);
    }
    ncplane* stdplane = notcurses_stdplane(nc);

    unsigned int cols = 30;
    ncplane_options opt2 = {
        .y = 0,
        .x = 0,
        .rows = 1,
        .cols = cols,
        .flags = NCPLANE_OPTION_AUTOGROW | NCPLANE_OPTION_VSCROLL,
    };
    ncplane* parent = ncplane_create(stdplane, &opt2);

    ncplane_options opt3 = {
        .y = 0,
        .x = 0,
        .rows = 30,
        .cols = cols,
    };
    ncplane* child = ncplane_create(parent, &opt3);
    auto d = ncplane_dim_y(parent);

    notcurses_stop(nc);

    std::cout << d << std::endl;
}

A parent plane is created with one row. Then a child plane is created with 30 rows. I would expect the parent plane to grow to have 30 rows, but d turns out to be 1. Is the parent plane not growing or is it not updating the dimension information?

@lokxii lokxii added the bug Something isn't working label Apr 8, 2024
@dankamongmen dankamongmen self-assigned this Apr 8, 2024
@dankamongmen dankamongmen added this to the 3.1.0 milestone Apr 8, 2024
@lokxii
Copy link
Author

lokxii commented Apr 9, 2024

Actually I am not even sure what was the intended behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants