4

I've created basic Hello World app using Flutter template and now running it on Linux using flutter run command.

In application window top panel ("Title bar") there is text "hello_world" and I am trying to figure out how to change this default.

enter image description here

Note: I am not trying to modify it dynamically. Just need to set it to static text.

1 Answer 1

8

Inside the linux folder, locate a file called my_application.cc and locate this line of code

if (use_header_bar) {
    GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
    gtk_widget_show(GTK_WIDGET(header_bar));
    gtk_header_bar_set_title(header_bar, "some_app"); //<----- change this
    gtk_header_bar_set_show_close_button(header_bar, TRUE);
    gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
  } else {
    gtk_window_set_title(window, "some_app"); //<----- change this
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.