Re: GtkAllocation accessor

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

 



On Wed, Jun 02, 2010 at 03:01:18PM +0200, Tadej Borov??ak wrote:
> Hi.
>
> > OK - you did see my constructor example, no? It would be cleaner the other
> > way, wouldn't it?
>
> I'm not a GTK+ developer and cannot speak for them, but having
> consistent API is far more important to me than having some parts of
> the code being brief.

It isn't so much being brief, but that the change from being able to
access widget->allocation.width directly to needing to use
gtk_widget_get_allocation because of the decision to make code compile
with GSEAL_ENABLE means that I now have to invent


#if GTK_CHECK_VERSION (2,18,0)
static GtkAllocation *dasher_get_widget_allocation(GtkWidget *w)
{
        GtkAllocation a;

        gtk_widget_get_allocation(w, &a);

        return &a;
}
#endif


and then convert

CCanvas::CCanvas(GtkWidget *pCanvas, CPangoCache *pPangoCache)
#if GTK_CHECK_VERSION (2,18,0)
  : CDasherScreen(dasher_get_widget_allocation(pCanvas)->width,
                  dasher_get_widget_allocation(pCanvas)->height) {
#else
  : CDasherScreen(pCanvas->allocation.width, pCanvas->allocation.height) {
#endif


which seems unnecessary.


Cheers,

Patrick
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux