Skip to content

Commit

Permalink
Merge pull request #157 from schriftgestalt/master
Browse files Browse the repository at this point in the history
Replace deprecated constants
  • Loading branch information
justvanrossum authored Dec 13, 2021
2 parents ad8eba3 + 8b0d105 commit 04285ce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Documentation/source/conf.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Lib/vanilla/vanillaButton.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from AppKit import NSButton, NSImage, NSBundle, NSRoundedBezelStyle, NSShadowlessSquareBezelStyle, NSHelpButtonBezelStyle, NSMomentaryPushInButton, NSCommandKeyMask, NSAlternateKeyMask, NSAlternateKeyMask, NSShiftKeyMask, NSAlphaShiftKeyMask, NSHelpFunctionKey, NSHomeFunctionKey, NSEndFunctionKey, NSPageUpFunctionKey, NSPageDownFunctionKey, NSDeleteFunctionKey, NSLeftArrowFunctionKey, NSRightArrowFunctionKey, NSUpArrowFunctionKey, NSDownArrowFunctionKey, NSImageLeft, NSImageRight, NSImageAbove, NSImageBelow, NSImageOnly, NSRightTextAlignment, NSLeftTextAlignment, NSNoCellMask
from AppKit import NSButton, NSImage, NSBundle, NSRoundedBezelStyle, NSShadowlessSquareBezelStyle, NSHelpButtonBezelStyle, NSMomentaryPushInButton, NSCommandKeyMask, NSAlternateKeyMask, NSAlternateKeyMask, NSShiftKeyMask, NSAlphaShiftKeyMask, NSHelpFunctionKey, NSHomeFunctionKey, NSEndFunctionKey, NSPageUpFunctionKey, NSPageDownFunctionKey, NSDeleteFunctionKey, NSLeftArrowFunctionKey, NSRightArrowFunctionKey, NSUpArrowFunctionKey, NSDownArrowFunctionKey, NSImageLeft, NSImageRight, NSImageAbove, NSImageBelow, NSImageOnly, NSTextAlignmentRight, NSTextAlignmentLeft, NSNoCellMask
from vanilla.vanillaBase import VanillaBaseControl


Expand Down Expand Up @@ -307,9 +307,9 @@ def __init__(self, posSize,
else:
position= _imagePositionMap[imagePosition]
if imagePosition == "left":
self._nsObject.setAlignment_(NSRightTextAlignment)
self._nsObject.setAlignment_(NSTextAlignmentRight)
elif imagePosition == "right":
self._nsObject.setAlignment_(NSLeftTextAlignment)
self._nsObject.setAlignment_(NSTextAlignmentLeft)
if not bordered:
self._nsObject.cell().setHighlightsBy_(NSNoCellMask)
self._nsObject.setImagePosition_(position)
Expand Down
4 changes: 2 additions & 2 deletions Lib/vanilla/vanillaCheckBox.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from AppKit import NSSwitchButton, NSShadowlessSquareBezelStyle, NSLeftTextAlignment, NSNoCellMask
from AppKit import NSSwitchButton, NSShadowlessSquareBezelStyle, NSTextAlignmentLeft, NSNoCellMask
from vanilla.vanillaButton import Button
from vanilla.vanillaBase import osVersionCurrent, osVersion10_10, VanillaBaseObject

Expand Down Expand Up @@ -136,7 +136,7 @@ def __init__(self, posSize, title, callback, sizeStyle):
super(_CheckBoxManualBuildTextButton, self).__init__(posSize, title=title, callback=callback)
self._nsObject.setBordered_(False)
self._setSizeStyle(sizeStyle)
self._nsObject.setAlignment_(NSLeftTextAlignment)
self._nsObject.setAlignment_(NSTextAlignmentLeft)
self._nsObject.cell().setHighlightsBy_(NSNoCellMask)


Expand Down
12 changes: 6 additions & 6 deletions Lib/vanilla/vanillaTextBox.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from AppKit import NSTextField, NSAttributedString, NSLeftTextAlignment, NSRightTextAlignment, NSCenterTextAlignment, NSJustifiedTextAlignment, NSNaturalTextAlignment
from AppKit import NSTextField, NSAttributedString, NSTextAlignmentLeft, NSTextAlignmentRight, NSTextAlignmentCenter, NSTextAlignmentJustified, NSTextAlignmentNatural
from vanilla.vanillaBase import VanillaBaseControl


_textAlignmentMap = {
"left": NSLeftTextAlignment,
"right": NSRightTextAlignment,
"center": NSCenterTextAlignment,
"justified": NSJustifiedTextAlignment,
"natural": NSNaturalTextAlignment,
"left": NSTextAlignmentLeft,
"right": NSTextAlignmentRight,
"center": NSTextAlignmentCenter,
"justified": NSTextAlignmentJustified,
"natural": NSTextAlignmentNatural,
}


Expand Down

0 comments on commit 04285ce

Please sign in to comment.