Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats the difference between sending a widget a (SEL_COMMAND, FXWindow::ID_SHOW) message and just calling its show() method directly?

directly message method widget
0
Posted

Whats the difference between sending a widget a (SEL_COMMAND, FXWindow::ID_SHOW) message and just calling its show() method directly?

0

It’s an efficiency issue, related to the layout algorithm. In most cases, when a window gets the FXWindow::ID_SHOW message, the default handler calls show() and then calls recalc() to mark the window’s layout as “dirty” (i.e. scheduled for a re-layout). But since show() and hide() are themselves used in layout() in many cases, calling recalc() inside the implementation of show() and hide() would cause yet another layout() to happen.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.