Re: Why use Gtk2::Bin ?

On Dec 17, 2005, at 2:47 PM, zentara wrote:

I was just wondering, why are Windows and Buttons
derived from Gtk2::Bin  instead of Gtk2::Box?

Does it make them more efficient?

I don't claim to have insight into the minds of the gtk+ authors, but my guess is that it's because Windows and Buttons conceptually just have one child. That child may be a box that has more children, but that box is a single child. It wouldn't make sense to have Window or Button descend from Box, because Box is a base that must be subclassed with a direction --- how wasteful to require the existence of HButton & VButton, or HWindow and VWindow.

The door is locked. I tried to open it, but the lock is harder to pick than a broken nose.
  -- Sensei, on 'I, Ninja'

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