Fetches an ID from the pool of IDs allocated to Context Menu. If we don't have enough ID's to fulfill request, create new ID and add it to the pool. See GH Issue #589. Has to be static method to properly handle modifications of primitives from subclass
()
| 177 | |
| 178 | @staticmethod |
| 179 | def nextID(): |
| 180 | """ |
| 181 | Fetches an ID from the pool of IDs allocated to Context Menu. |
| 182 | If we don't have enough ID's to fulfill request, create new |
| 183 | ID and add it to the pool. |
| 184 | |
| 185 | See GH Issue #589. |
| 186 | Has to be static method to properly handle modifications of primitives from subclasses (_idxid). |
| 187 | """ |
| 188 | ContextMenu._idxid += 1 |
| 189 | |
| 190 | if ContextMenu._idxid >= len(ContextMenu._ids): # We don't ahve an ID for this index, create one |
| 191 | ContextMenu._ids.append(wx.NewId()) |
| 192 | |
| 193 | return ContextMenu._ids[ContextMenu._idxid] |
| 194 | |
| 195 | def isChecked(self, i): |
| 196 | """If menu item is toggleable, this should return bool value""" |
no test coverage detected