digitalmars.D.learn - DlangUI: how to change AppFrames?
- Ki Rill (7/7) Oct 23 2023 I know how to change the current AppFrame:
- Imperatorn (2/9) Oct 23 2023 Saving the previous frame not an option?
I know how to change the current AppFrame: ```D window.mainWidget = myFrame; ``` But how do I exit this frame? I press the button, change to new frame, do the work, and now I want to return to the previous frame. How would I do this?
Oct 23 2023
On Tuesday, 24 October 2023 at 04:38:58 UTC, Ki Rill wrote:I know how to change the current AppFrame: ```D window.mainWidget = myFrame; ``` But how do I exit this frame? I press the button, change to new frame, do the work, and now I want to return to the previous frame. How would I do this?Saving the previous frame not an option?
Oct 23 2023
On Tuesday, 24 October 2023 at 05:03:51 UTC, Imperatorn wrote:On Tuesday, 24 October 2023 at 04:38:58 UTC, Ki Rill wrote:It crashes if I reset it to the previous one. ```d button.click = delegate(Widget src) { // window.mainWidget = homeLayout.child(0); window.mainWidget = myPreviousFrame; return true; }; // crash ```I know how to change the current AppFrame: ```D window.mainWidget = myFrame; ``` But how do I exit this frame? I press the button, change to new frame, do the work, and now I want to return to the previous frame. How would I do this?Saving the previous frame not an option?
Oct 24 2023
On Tuesday, 24 October 2023 at 08:20:19 UTC, Ki Rill wrote:On Tuesday, 24 October 2023 at 05:03:51 UTC, Imperatorn wrote:I think there was some kind of issue when changing widgets like that. Please try doing this instead: ```d window.executeInUiThread(() => window.mainWidget = myPreviousFrame); ``` Also, please post whole code so maybe I can fix this laterOn Tuesday, 24 October 2023 at 04:38:58 UTC, Ki Rill wrote:It crashes if I reset it to the previous one. ```d button.click = delegate(Widget src) { // window.mainWidget = homeLayout.child(0); window.mainWidget = myPreviousFrame; return true; }; // crash ```I know how to change the current AppFrame: ```D window.mainWidget = myFrame; ``` But how do I exit this frame? I press the button, change to new frame, do the work, and now I want to return to the previous frame. How would I do this?Saving the previous frame not an option?
Oct 24 2023
On Tuesday, 24 October 2023 at 11:23:05 UTC, GrimMaple wrote:I think there was some kind of issue when changing widgets like that. Please try doing this instead: ```d window.executeInUiThread(() => window.mainWidget = myPreviousFrame); ``` Also, please post whole code so maybe I can fix this laterIt does not work. It does accept new widgets though, but crashes if I try to change to the previous one. I posted the whole code to GitHub [issue](https://github.com/buggins/dlangui/issues/677).
Oct 26 2023