Re: GtkExpander/GtkDisclosure



I just wanted to say, first, that I don't think your code is really all that complex anyway,
so if I were you I wouldn't go through the work to change it.

But, if you wanted to ...

	Yes, I considered this. But what you'd really end with is both
approaches. You'd need to implement a GtkCheckButton sub-class and embed
that in the GtkBin sub-class. Also, it would be a little weird because
most of the operations you need to do would be on the GtkCheckButton
sub-class and that's where the "toggled" signal would come from too.

I don't think you would need to sub-class GtkCheckButton. You could just use its public API for what you need I think. You're right though, you would end up having to relay some of the stuff to your widget.

	So, yes I think it would simplify the implementation but I think it
would be a very confusing API for such a conceptually simple widget.

I think either way could use the same external API.

	You need to recieve button press and motion/crossing events. You can't
do that with a NO_WINDOW widget right ?
I was actually talking about if you switched to using GtkCheckButton. Note though that a NO_WINDOW widget can still have a GdkWindow in order to receive events. GtkButton is an example of this, I think. I think doing that for your widget would make the code more complex though.

In the end, I don't think implementation matters too much, as long as the API is good and the widget isn't noticably slow.

--Ray




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