Why are Aspect-Ratio Considerations Tied to a Frame?



  Hello,

  I would like to ask a question on aspect-ratio containers.

  I'm writing an application that uses OpenGL widgets (via gtkglextmm). All of these widgets rely on the fact that their aspect ratio is fixed. I noticed that gtkmm includes AspectFrame, but since I'm not using these widgets as part of any logical group, I don't need any frame. I consequently used the documentation on custom containers to write an aspect-ratio container.

  Everything about gtkmm is great, both classes and docs, but I don't understand the rationale for AspectFrame. From "Design Patterns" (by the GoF), it seems that aspect-ratio enforcements should be a "decorator" for a different component (this is how I've implemented it). Now if gtkmm had an AspectRatioContainer class, it would:
A. Allow to enforce aspect ratios on any other component.
B. As a special case, it could enforce aspect ratios on frames, or, alternatively, a frame could contain an AspectRatioContainer object. Put differently, I see AspectFrame as simply a decorator decorating both frame and aspect-ratio.
  So were gtkmm to include something like AspectRatioContainer instead of AspectFrame, it seems the number of classes would be the same, but the applicability would be greater. I was wondering why AspectFrame was chosen.

  Thanks,

  Ami

 


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