Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Lib/vanilla/vanillaRadioGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from vanilla.vanillaBase import VanillaBaseControl, _sizeStyleMap
from vanilla.vanillaButton import Button
from vanilla.vanillaStackGroup import VerticalStackGroup, HorizontalStackGroup
from objc import super

try:
from AppKit import NSRadioButtonType
Expand All @@ -23,7 +24,7 @@ def _init(self, cls, posSize, titles, callback=None, sizeStyle="regular"):
self._buttonHeight = self._heights[sizeStyle]
self._callback = callback
self._sizeStyle = sizeStyle
super().__init__(posSize, spacing=spacing, alignment="leading")
cls.__init__(self, posSize, spacing=spacing, alignment="leading")
self._buildButtons(titles, sizeStyle)

def _buildButtons(self, titles, sizeStyle):
Expand Down Expand Up @@ -126,7 +127,7 @@ def radioGroupCallback(self, sender):
)

def __init__(self, posSize, titles, callback=None, sizeStyle="regular"):
self._init(VerticalRadioGroup, posSize, titles, callback=callback, sizeStyle=sizeStyle)
self._init(VerticalStackGroup, posSize, titles, callback=callback, sizeStyle=sizeStyle)


class HorizontalRadioGroup(HorizontalStackGroup, _RadioGroupMixin):
Expand Down Expand Up @@ -188,7 +189,7 @@ def radioGroupCallback(self, sender):
)

def __init__(self, posSize, titles, callback=None, sizeStyle="regular"):
self._init(HorizontalRadioGroup, posSize, titles, callback=callback, sizeStyle=sizeStyle)
self._init(HorizontalStackGroup, posSize, titles, callback=callback, sizeStyle=sizeStyle)


class RadioButton(Button):
Expand Down