Missing set_window_title() #4566
StefanSalewski
started this conversation in
General
Replies: 2 comments
-
The API changed because now egui can handle multiple native windows, which are referred to as "viewports", because egui is used for things other than desktop applications, where the notion of native window doesn't necessarily exist. This was introduced in #3172. If you put this in the if ui
.text_edit_singleline(&mut self.name)
.labelled_by(name_label.id)
.changed()
{
ui.ctx()
.send_viewport_cmd(egui::ViewportCommand::Title(self.name.clone()));
} It will change the window title to whatever you write in the text field. See ViewportCommand for more. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much for this fast and helpful reply. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I started playing with egui some days ago, based on the example https://github.com/emilk/egui/tree/master/examples/hello_world
That example sets a static window title. But I would like to have a dynamic one as in GTK, so that I can use the title to display messages, as the last move in a chess game. I have spent a few hours for searching, and some results mentioned a function set_window_title(), while https://www.reddit.com/r/rust/comments/1ccfpug/comment/l15zl8p/ tells us
So I would assume that such a functionality is available, but I am unable to find something.
Beta Was this translation helpful? Give feedback.
All reactions