PyCStatusBarCtrl.GetParts

(int) = GetParts(nParts)

Retrieve coordinates of the parts in a status bar control.

Parameters

nParts : int

The number of coordinates to retrieve

Comments

This function, as designed in MFC, returns both the *number* of parts, and, through an OUT parameter, an array of ints giving the coordinates of the parts. There is also an IN parameter saying how many coordinates to give back. Here, we're explicitly changing the semantics a bit.


GetParts() -> Tuple of all coordinates
GetParts(n) -> Tuple of the first n coordinates (or all coordinates, if fewer than n)

So, in Python, you can't simultaneously find out how many coordinates there are, and retrieve a subset of them. In a reasonable universe, there would have been GetParts() -> int, and GetCoords() -> List. This means that I need to call the MFC method twice; once to find out how many there are, and another time to get them.