2
votes

I have a widget (a GtkBox, box1) inside another container (a GtkFrame, frm1) created with Glade and I shall add a GtkCanvas to box1 programmatically. Given only box1 how can I get it's parent, frm1, from it?

Additionally, how can I discover if a GtkFrame already has a child?

I'm creating a graphics tool which will take box1 as an arg to an initialize function which needs to discover frm1 so that the tool can use CSS to paint a border that informs the user that frm1 and the box1 child canvas has focus.

I could just pass frm1 as an arg as well but I want to keep things minimal for the user.

1

1 Answers

1
votes

According to the Gtk.jl module documentation, it's as simple as:

frm1 = parent(box1)