Does anyone know how to have subwindows within a mainframe window in the Piston ecosystem in Rust?

In MS Windows programming, there is a concept of a mainframe and then subwindows and dialogs within the mainframe.

I'm having trouble finding examples of mimicking the same using the Piston ecosystem in Rust. I've built a piston-based window with a nice chessboard, but would like to have it be a component within an encompassing main window.

Is anyone already familiar with how to do this?

Apparently there is currently no way to have multiple windows in an app using piston_window. There is something seriously wrong with the crate or something wrong with the crates it uses.

I do not recommend the piston ecosystem for anyone requiring multiple windows in their app. It's a real shame too since their sprite crate is wonderful.

How did you come up with that conclusion?

It sounds like you’re talking about a Multiple-document interface. Games that do this usually use a separate widget library (such as conrod) for the interior windows instead of using the OS’s MDI system— It’s quite unusual these days to see a game that uses more than one OS window.

If that’s what you want to do, you might have better luck picking a GUI framework that’s designed more for general-purpose applications than games.

1 Like

The example for piston examples ( produces a segmentation fault that has not been solved for 3 years now; something to do with either X11 or the way winit works. The example does work under the windows OS, which is particularly unpleasant since many like me prefer Linux.

Hmm ... perhaps this is due to some differences between Windows and X? You did mention "in MS Windows programming," so I'm guessing perhaps the concept of windows is defined differently? (I'm not really familiar with this topic, so I'm just speculating :neutral_face:)

@2e71828 Conrod does not provide child windows(reposition, expand, contract, resize) within the main window, and if it did, I would definitely stick with the piston ecosystem since I like its modularity.

There are many apps that have the game + GUI widgets requirement; especially, for example, an online chess interface app which needs simple 2D animation in main window with several child windows with scrolling for event and other chess-related feedback.

It's also convenient to move and reshape the child windows as needed, or have multiple chess board window displays during analysis.

There are other ongoing Rust-based multiplat toolkits under development such as OrbTk, ezgui, and Iced, but they are not 100% ready yet. There's also an effective offering of imgui + ggez that also nicely covers how to use them in tandem with the ECS paradigm.

Requirements can be met with Rust, but my selection of piston has been disappointing. I'm certain things will improve with time!

All I know is that other Rust frameworks do not have this problem like piston does.

I’ve never used it, but it looks like the floating layout method is intended to provide exactly this.

Certainly, but this isn’t the sort of interface that most game engines are optimized for. They’re really designed for full-screen immersive experiences— the requirements you describe are closer to those of Inkscape than of Fallout.

The floating layout almost provides what I'm alluding, but they are windows that are refreshed synchronously after the main window and other widgets and are used mainly for popups and alerts.

The multi-window scenario I describe provides child windows each with their own asynchronous updating/refreshing; used for more than just popups or alerts. ----But "Thank You" for your feedback!

Your words are spot on!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.