Custom container + Child type with interface



I'm implementing a custom container widget which needs to only accept
child widgets which derive from GtkWidget (obviously) but also implement
a custom Interface called GpanesPanel.

I'm not sure how to enforce this rule within my code's API. What type
should the container's child_type() method return? GPANES_TYPE_PANEL or
GTK_TYPE_WIDGET? Likewise, I'm not sure what type custom insertion
methods for my container should accept, GpanesPanel or GtkWidget?

It doesn't seem enough to use GPANES_TYPE_PANEL/GpanesPanel because, as
it stands, any non-widget class could implement the GpanesPanel
interface but would be unusable as a container child.

Is there anything I can put in the GpanesPanel interface definition that
states that it can only be applied to classes derived from GtkWidget?

I hope I've explained my problem clearly enough. Suggestions gratefully
received.

Matt.




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