dibyendu
dibyendu

Reputation: 321

How to get parent window from a child widget in Gtk4?

In case of Gtk3, I used the function gtk_widget_get_parent_window to get the parent window from the child widget. But this function is not available in Gtk4. How to get parent window from a child widget in Gtk4?

Upvotes: 2

Views: 80

Answers (1)

Holger
Holger

Reputation: 1020

The corresponding function in GTK4 is:


GtkWidget*
gtk_widget_get_parent (
  GtkWidget* widget
)

In Gtk4, the meaning of the GtkWidget has been increased overall. Thus, a window should always be created as a GtkWidget, so that you can then easily convert it for the corresponding functions with GTK_WIDGET(...). Greetings

Upvotes: 1

Related Questions