Re: How to "extend" a widget?



jacky wrote:
What I was looking into would be more taking an existing widget, and
modifying it a little, as in changing its behavior on some aspect, or
adding a feature, something like that.

My question is: what would be the best/standard/recommanded way to do
such a thing?

Widgets are not plugins. They are whole objects. There is no extensible feature to them.

You will have two choices:

1. Copy an entire GTK widget and give it a unique name.
   Example: GtkButton becomes GtkMyButton

2. Create a shell widget that uses existing GTK widgets inside of it to do what you want. In the event you need to touch the GTK widgets inside, you can make your new widget a simple struct and have pointers to the interior GTK widgets.

I would suggest number 2, unless you are doing something very radical.



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