Replies: 2 comments 1 reply
-
cannot help you much without seeing your code :( let say you have a button that when clicked toggles a window. you cannot just do if ui.button("toggle window").clicked() {
Window::new(&ctx, |ui| {});
} because when you click the button, it will draw a window just for that frame, and next frame it would not draw the window unless you are clicking the button again. you need to instead have a bool stored in your app state somewhere. if ui.button("toggle window").clicked() {
app_state.enabled_window = !app_state.enabled_window;
}
// and here, you check if the window needs to be draw
if app_state.enabled_window {
Window::new(&ctx, |ui| {});
} so, just remember that everything you do with your code actually has some state stored in your app struct. and use that state, to make decisions of how to write your UI code. by seeing your code, it would be easier to give you a targeted answer. there's a discord if you find that easier to work with and find help live. https://discord.gg/JFcEma9bJq |
Beta Was this translation helpful? Give feedback.
-
Code is part of the problem in I am not sure where to even start. I pulled the Demo down and found where the menu items are created and added my own to it. The screen displays and I can select items from the menu. I have println! statements that confirm I am in the area. What happens is the screen blinks in the area I am writing to but reverts back to the original display. I want to stop the blink and allow me to work in the area I am building. From what I understand is the display is in continuous mode and I want reactive mode but can not figure out how to change it. |
Beta Was this translation helpful? Give feedback.
-
I am writing a window style menu system for an application I am building. I am using Rust since it is across Mac, Linux, and Windows. I saw the demo of EGUI and it is just what I was looking for. Unfortunately I am having trouble how to start for someone that does not already know the EGUI system. I tried following the suggestion of using the Demo as a starting point and was able to make the menu system like I wanted but can not get the under lying actions with the display to work. The one panel I am trying to display blinks when the menu item is chosen so I believe the selection process is working and that the window is trying to be built. Any suggestions on where to learn is appreciated. I don't mind reading or tearing code apart to learn just have not been able to find any areas to study from. Help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions