Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Questions on calendar.beginInit() (Read 989 times)
Michael Hopkins
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 23
Joined: Apr 5th, 2022
Questions on calendar.beginInit()
Apr 18th, 2022 at 5:33pm
Print Post  
What does beginInit/endInit actually do?

Do we need to beginInit and endinit when we are changing anything that has to do with the calendar? Such as when we do the draw event or change the dates on in the timetable view?

What happens if we nest begininit calls?

Any information would be helpful. Thanks. Smiley
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Questions on calendar.beginInit()
Reply #1 - Apr 18th, 2022 at 6:43pm
Print Post  
Hi,

beginInit sets a flag to avoid rebuliding calendar's hierarchy of cells, and updating child Swing components' states (month buttons on top, scrollbars), until you call endInit. Call these to save some time when adding dates or resources in a batch.

Quote:
Do we need to beginInit and endinit when we are changing anything that has to do with the calendar?


You don't have to. They will only save some time if you do a batch of large changes, like adding multiple dates to timetable view, or multiple resources to resource view.

Quote:
Such as when we do the draw event or change the dates on in the timetable view?


No need to call them from custom-draw event handling if that's what you mean, since drawing code is not supposed to change calendar's state, but only present it. Not helping much around one-liners such as date changes too.

Quote:
What happens if we nest begininit calls?


These toggle a boolean flag, so better do not nest the calls Smiley

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint