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

Added State.program_mut. #2666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bobbens
Copy link

@bobbens bobbens commented Nov 8, 2024

I'm working on a non-standard application where iced is embedded in a game using sdl2 + wgpu. I need to be able to create multiple overlapping "pseudo-windows" (basically collection of widgets) and am using a modal-like approach for this. I need to be able to create new "pseudo-windows" dynamically based on the game state that can be triggered by events that iced will not receive. I've got it mainly working, but am having issues with the isolation that iced_runtime::program::State does around the program it is encapsulating.

Currently, it's possible to get an immutable program reference with State.program, however, it is not possible to get a mutable one. Simply adding the State.program_mutmethod would simplify all my code and logic without having to deal with messages that have to be Send. This PR just adds State.program_mut. I have tested and the integration example works fine with it.

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

Successfully merging this pull request may close these issues.

1 participant