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

Modify child_window example #4054

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Modify child_window example #4054

wants to merge 20 commits into from

Conversation

Sl-L
Copy link

@Sl-L Sl-L commented Dec 23, 2024

Currently, the child_window example fills the child windows with the same color as the parent window, so the creation and presence of a child window is only perceptible through the terminal messages. In addition to that, all child windows are placed on top of one another.
What I did was change the fill_window function defined in examples/util/fill.rs so that it accepts a color argument, then I had to copy the color that was hardcoded and put it as argument on all calls to fill_window on the other examples. I originally wanted use transparency on the parent window instead, changing the alpha channel of the color on fill_window and adding the transparency attribute to the parent window but, while it worked for me, there's an open issue in transparency (#2502) so I decided it may not be a good idea
After that I added a child_counter to spawn_child_window of the child_window example and use it to calculate a position for the new child_window on a 5 column grid. Also changed the child window size from 200x200 to 128x96 so that a 5x5 grid gets formed if the initial size of the parent window is kept.

Sl-L added 2 commits December 23, 2024 10:37
…ith a different color than the parent window and made it so the child windows fill a grid instead of stacking on top of one another
@Sl-L Sl-L changed the title Dev Modify child_window example Dec 23, 2024
examples/util/fill.rs Outdated Show resolved Hide resolved
examples/child_window.rs Outdated Show resolved Hide resolved
@Sl-L Sl-L requested a review from kchibisov December 25, 2024 16:38
examples/child_window.rs Outdated Show resolved Hide resolved
examples/child_window.rs Outdated Show resolved Hide resolved
@Sl-L Sl-L requested a review from kchibisov December 28, 2024 14:29
@madsmtm madsmtm added the S - docs Awareness, docs, examples, etc. label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - docs Awareness, docs, examples, etc.
Development

Successfully merging this pull request may close these issues.

3 participants