Multi-page application #5302
-
Hello! I'm writing a somewhat complex desktop application in Rust using egui. The application requires having multiple views, pages, screens, call it what ever. Is there something that I can use in egui to implement this? Or is this not implemented yet in egui? For example my program is going to be pulling multiple pieces of data from multiple URLs but these URLs require different variables be passed, so I need to have different inputs appear based on what is being pulled up. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! That's definitely possible. enum Page {
Home(HomePage),
Post(PostPage),
} and HomePage and PostPage would be structs holding the different variables for your different pages, eg PostPage could have a post_id. You could also have a look at egui_router which allows you to define routes like in axum and has support for reading the url params and for customizable page transitions. |
Beta Was this translation helpful? Give feedback.
Hi! That's definitely possible.
For different pages, you could e.g. use an enum, something like:
and HomePage and PostPage would be structs holding the different variables for your different pages, eg PostPage could have a post_id.
You could also have a look at egui_router which allows you to define routes like in axum and has support for reading the url params and for customizable page transitions.