Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

GtkBin:Containers With One Child

GtkBin doesn't introduce any new interfaces; it simply adds a data member to each container instance for storing a single child, and provides default implementations for the container methods that operate on this one child. GtkBin implements the add, remove, forall, and child_type methods from GtkContainer; combined with GtkContainer's default implementations, simple subclasses of GtkBin (such as GtkEventBox, GtkAlignment, and GtkFrame) do not need to override any GtkContainer methods. Here's the instance struct:


typedef struct _GtkBin       GtkBin;

struct _GtkBin
{
  GtkContainer container;

  GtkWidget *child;
};

      

And the class struct:


typedef struct _GtkBinClass  GtkBinClass;

struct _GtkBinClass
{
  GtkContainerClass parent_class;
};

      

No rocket science here.

Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire