changed() triggers repaint() ?



  • Since when this.changed() automatically triggers a repaint() ? Thought it was only triggering the object's callback so I systematically call a repaint in the CB...
    Please don't tell me always! 🤞 😬



  • @ustk I thought the same as you



  • @d-healey I have very complex UI panels and all the paint computation was actually made twice (even four times because of the interaction between them). So I investigated today and found this. As long as you're calling changed() in the mouse callback, you never need to repaint... (except some edge cases where you don't need the main CB to be called)



  • Check this out:
    No repaint method, and I even removed the slave panel CB!

    HiseSnippet 1207.3oc4W0sSabDEdVfIEusVsQp89Qb05VvrlljVonpXvXZsJ1rkkPRUUUXX2w1iX8LV6N1D2HdZ508cnOB4t9Pza5aP6Y1+MXPDKwUcERl47624mYOm0IT5whhjgHiJmLaLCY7IX2YB0vVCobApy9Hiu.2kFoXga4FPmxHioBVPDZuYioQQLejgwpeuVTiJqghe9mWrGMfJ7XEjPnSkbO1g7QbUAUml+HOH3.pO6D9nRR+jlc7jhVx.4D.VqhsQiodWPGv5Q0hsBFY7n19bkLzUQUrHjwZ6I8m4NTdoHQ9S4Q7yCX5CMPtfgRHefLvWiXMUTqg7.emrvOBAVwoHYrZRx3ywc497b5EIkOKlAoPix4CiUtK30nL7ru+vynD7VKAdOF65ExGqJ3nw1Gi6Hf5UeJTBJCqDYQq7GXbKIHgPUeD8B1AgvgbMrdls8ljmZaW64UMAwhjAr5dALZnklRUSnzDoHSogjQwsENh.x2QxL3.lpkbzXo.NXsQtDan0sPyHcmzcoXl.aj3yplauMo6ttmz9Xhytc5cRUybSWOhobfxh5X4DEWvr5OQ3o3Rg0fZUMeWUyJCzhjzNYk7ST8yY7ALswAt9gzKOl4or9EHxg+TC4QZ77JtuZnUsBB+.nzPkUsecSxNw5pikYPUNTAQRlTmRClvrpQ9xanWh65CM84tKQ66iO0ZeUV5nbBo6QuzsMo0dWKmzUNIh0hFDbNb4oHovlBI3zDCuOI4LTf4dWv7qk3VephV2GZWiCkaFZ53XN0gL3fZZKRfmzez4loZ46ICGQC3+FyGrzVMf7RIsdMYKRwoetFYaxN11OujMDrKyfQWpZX8PpX.yZQ37qtt+hqlMzvkj9DqVTVfjY5ZY9Kls2PsG7SByqtkjtNcyEAP+FIK0Rjh7BftqNTFX4k0RuYB1zI93LTVCdAXllijbdkQxUIWGu6KYIM5wtNuxeSTMW73d3tm1l3z6vplkwz+6tQUpJ1SpXGIrpY9NyJlWYRtNq98WHuzra.Kbgr0y3BuKEsDSFcNKLqSISP3k8yOMAe6SSJOryKoYojfRQGAWczXl31lwfR6vzSaRQEHpJdVS0rYM54+HtudNSdmEJFy5Q3l+0uO9u+o2+BzK6rOb8LyRfQAGMlEp35XvXe1TXgfjoXUv6yhtPIGCgZdeMxX86ieea9ZC+oeyY4GZxZdottWP3jlCiq6ETNqIbEQdY1EE.UeJd2f.RAgH39PGgSHC51ALuBpD5dzsgNSb18nRf68S9fAWYmgm2YGROO0Yqii++Fkb0YzRt5ryZpXuUmLSWhC8gX1cJYVhZQl8ivwKEB6xcicSfMjj9SBnp4WaRuqXJCn6et8Sz6fHh3pYk2k7AYWp6KbeL1gq7FtX7txBvKzt+Pi2zMSqha2uO7NuBvtF9fW+vuFJJYnv.XVbHGZOv8lLxEF.3w.jHh+z.CLbUQqZ7Ya8YclwkI7iO7uvSJyF5yFoLajwDMh5EJeiWxafz69tdLE.Sh3OAnBzMCmIMxduCFaW2FMBVI+Mdd5TwV.1WrN6rD570KgNOYIz4oKgNOaIz4aVBc916TG8WCs6DkbTx0DffS632+aXzVPgtr3NRz+AM9pBf.
    


  • Very nice! But you have two paint routines that are identical, why not just use one?



  • @d-healey Was just for the sake of the example... In my actual project, widgets are totally different...


Log in to reply
 

7
Online

595
Users

2.3k
Topics

18.3k
Posts