4 ms·
Yes, using the same Gtk example, the way you’d forward declare GtkLabel without including gtklabel.h in your header would be: struct _GtkLabel; typedef
by apaprocki 8mo ago
Yes, using the same Gtk example, the way you’d forward declare GtkLabel without including gtklabel.h in your header would be:
struct _GtkLabel;
typedef struct _GtkLabel GtkLabel;
// Use GtkLabel* in declarations
- 1718627440 8mo agoWhy are you complicating things? Struct and Unions are different namespaces for a reason. typedef struct GtkLabel GtkLabel; works just fine.
- apaprocki 8mo agoI’m simply stating how actual Gtk is written: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.h#L39 https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel....
- 1718627440 8mo agoTrue, thanks then. As far as I see it they don't even use the struct in the implementation, so I guess it makes some sense.