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

Make elements fill column / row #118

Open
bc-arl opened this issue Oct 31, 2023 · 0 comments
Open

Make elements fill column / row #118

bc-arl opened this issue Oct 31, 2023 · 0 comments

Comments

@bc-arl
Copy link

bc-arl commented Oct 31, 2023

Hi, I am developing an application where I have several buttons that I want all in a column like so:

  cvui::init(WINDOW);
  cv::Mat frame = cv::Mat(height, width, CV_8UC3);
  while (cv::waitKey(20) != 27) { // wait for esc
    frame = cv::Scalar(49, 52, 49); // color
    // I want this column to fill 1/3rd of the width, and the elements to stretch to fill the column
    cvui::beginColumn(frame, padding, padding, width/3, height - padding * 2);
      cvui::text("Bowlzone Calibration");`
      if (cvui::button("NE")) {
        megaMgr->adjustBowlZone("NE");
      }
      if (cvui::button("NW")) {
        megaMgr->adjustBowlZone("NW");
      }
      if (cvui::button("SE")) {
        megaMgr->adjustBowlZone("SE");
      }
      if (cvui::button("SW")) {
        megaMgr->adjustBowlZone("SW");
      }
    cvui::endColumn();
    // Will be adding some stuff here to fill the middle and right parts of the frame, not just left column
    cvui::update(WINDOW);
    cvui::imshow(WINDOW, frame);
  }

My goal is to have these elements in a column that takes up 1/3rd of the width of the column, and I want the elements to fill the column, evenly. I would assume this is the default behavior. However they are actually all bunched up at the top left of the column.

github

How do I make it so that elements stretch to fill the container (row/column) they are placed in? Here's a sketch of what I mean (excuse the bad paint sketch)

example

So here the column is 1/3rd width of frame, and elements evenly stretch to fill it.

Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant