Search code examples
c++gtkgtk3

How do I check the type of widget in GTK+3.0?


I saw this post but it was for Python so that doesn't help me too much. I'm programming in C++, working on a code-base that I didn't write. I see some checks like GTK_IS_ENTRY and GTK_IS_COMBO_BOX, but I'm not sure where this person found these or what other GTK_IS_... there are. Is there a reference to these somewhere?


Solution

  • The type checks macros are typically part of the API contract for a GObject, and they are conventionally provided by the library, so they don't end up in the documentation. All they do is call G_TYPE_CHECK_INSTANCE_TYPE with the given GType macro, like GTK_TYPE_ENTRY or GTK_TYPE_COMBO_BOX.