Re: Detecting a resize

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

 



So, this is how you can do this trick with the timer event in mzgtk2:

Given the object variables _redraw, _sa-w and _sa-h and the function
_last-zoom, which does the proper zooming depending on the last type
of zooming (zoom 100%, zoom to fit, etc.):

    (define (handle-size-allocation widget x y w h)
      (set! _redraw (+ _redraw 1))
      (if (> _redraw 10000) (set! _redraw 0))
      (if (not (and (= _sa-w w) (= _sa-h h)))
          (let ((r _redraw))
            (mzgtk2-timer-add 500 (lambda ()
                                    (if (= _redraw r) (_last-zoom))
                                    (set! _sa-w w)
                                    (set! _sa-h h)
                                    #f))))))

It's that simple.

--Hans



_______________________________________________
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