Commit 912a65af authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue 3068: Move idlelib.configDialog action button creation into a separate

method so it can be reused by the new extension dialog.
parent d8cc3563
...@@ -77,8 +77,15 @@ class ConfigDialog(Toplevel): ...@@ -77,8 +77,15 @@ class ConfigDialog(Toplevel):
def CreateWidgets(self): def CreateWidgets(self):
self.tabPages = TabbedPageSet(self, self.tabPages = TabbedPageSet(self,
page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General']) page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General'])
frameActionButtons = Frame(self, pady=2) self.tabPages.pack(side=TOP, expand=TRUE, fill=BOTH)
#action buttons self.CreatePageFontTab()
self.CreatePageHighlight()
self.CreatePageKeys()
self.CreatePageGeneral()
self.create_action_buttons().pack(side=BOTTOM)
Frame(self, height=2, borderwidth=0).pack(side=BOTTOM)
def create_action_buttons(self):
if macosxSupport.isAquaTk(): if macosxSupport.isAquaTk():
# Changing the default padding on OSX results in unreadable # Changing the default padding on OSX results in unreadable
# text in the buttons # text in the buttons
...@@ -86,30 +93,25 @@ class ConfigDialog(Toplevel): ...@@ -86,30 +93,25 @@ class ConfigDialog(Toplevel):
else: else:
paddingArgs = {'padx':6, 'pady':3} paddingArgs = {'padx':6, 'pady':3}
# Comment out button creation and packing until implement self.Help frame = Frame(self, pady=2)
## self.buttonHelp = Button(frameActionButtons, text='Help',
## command=self.Help, takefocus=FALSE,
## **paddingArgs)
self.buttonOk = Button( self.buttonOk = Button(
frameActionButtons, text='Ok', frame, text='Ok', command=self.Ok,
command=self.Ok, takefocus=FALSE, **paddingArgs) takefocus=FALSE, **paddingArgs)
self.buttonApply = Button( self.buttonApply = Button(
frameActionButtons, text='Apply', frame, text='Apply', command=self.Apply,
command=self.Apply, takefocus=FALSE, **paddingArgs) takefocus=FALSE, **paddingArgs)
self.buttonCancel = Button( self.buttonCancel = Button(
frameActionButtons, text='Cancel', frame, text='Cancel', command=self.Cancel,
command=self.Cancel, takefocus=FALSE, **paddingArgs) takefocus=FALSE, **paddingArgs)
self.CreatePageFontTab() # Comment out Help button creation and packing until implement self.Help
self.CreatePageHighlight() ## self.buttonHelp = Button(
self.CreatePageKeys() ## frame, text='Help', command=self.Help,
self.CreatePageGeneral() ## takefocus=FALSE, **paddingArgs)
## self.buttonHelp.pack(side=RIGHT, padx=5) ## self.buttonHelp.pack(side=RIGHT, padx=5)
self.buttonOk.pack(side=LEFT, padx=5) self.buttonOk.pack(side=LEFT, padx=5)
self.buttonApply.pack(side=LEFT, padx=5) self.buttonApply.pack(side=LEFT, padx=5)
self.buttonCancel.pack(side=LEFT, padx=5) self.buttonCancel.pack(side=LEFT, padx=5)
frameActionButtons.pack(side=BOTTOM) return frame
Frame(self, height=2, borderwidth=0).pack(side=BOTTOM)
self.tabPages.pack(side=TOP, expand=TRUE, fill=BOTH)
def CreatePageFontTab(self): def CreatePageFontTab(self):
parent = self.parent parent = self.parent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment