Re: Best practise inheritance



Hi

You don't have to use myWidget->parent since you dereference the pointer.
A pointer to a struct always points to the first field of the topmost
nesting level.

so it would be:

gtk_widget_set_name(myWidget);


Bests,
Joël



On Mon, Mar 20, 2017 at 6:29 PM, S. Jacobi <sjacobi mailueberfall de> wrote:
On Mon, 20 Mar 2017 18:10:16 +0100
Joël Krähemann <jkraehemann gmail com> wrote:

Hi

As Tristan told you. The struct contains the other struct as not using
a pointer.

struct MyCompositeWidget
{
  GtkAlignment alignment;

  GtkBox *box;
};

The parent-is-a-pointer mistake was just me not thinking when I wrote
the mail. If have seen it being done correctly everywhere. This makes
gtk_widget_set_name (myWidget->parent, "myWidget"); syntactically wrong
however.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]