code: def CreateWidgets(self):
      frameMain = Frame(self, borderwidth=2, relief=SUNKEN)
      frameMain.pack(side=TOP, expand=TRUE, fill=BOTH)
      frameButtons = Frame(self)
      frameButtons.pack(side=BOTTOM, fill=X)
      self.buttonOK = Button(
          frameButtons, text="OK", width=8, command=self.OK
      )
      self.buttonOK.grid(row=0, column=0, padx=5, pady=5)
      self.buttonCancel = Button(
          frameButtons, text="Cancel", width=8, command=self.Cancel
      )
      self.buttonCancel.grid(row=0, column=1, padx=5, pady=5)
      self.frameKeySeqBasic = Frame(frameMain)
      self.frameKeySeqAdvanced = Frame(frameMain)
      self.frameControlsBasic = Frame(frameMain)
      self.frameHelpAdvanced = Frame(frameMain)
      self.frameKeySeqAdvanced.grid(
          row=0, column=0, sticky=NSEW, padx=5, pady=5
      )
      self.frameKeySeqBasic.grid(
          row=0, column=0, sticky=NSEW, padx=5, pady=5
      )
      self.frameKeySeqBasic.lift()
      self.frameHelpAdvanced.grid(row=1, column=0, sticky=NSEW, padx=5)
      self.frameControlsBasic.grid(row=1, column=0, sticky=NSEW, padx=5)
      self.frameControlsBasic.lift()
      self.buttonLevel = Button(
          frameMain,
          command=self.ToggleLevel,
          text="Advanced Key Binding Entry >>",
      )
      self.buttonLevel.grid(row=2, column=0, stick=EW, padx=5, pady=5)
      labelTitleBasic = Label(
          self.frameKeySeqBasic,
          text="New keys for  '" + self.action + "' :",
      )
      labelTitleBasic.pack(anchor=W)
      labelKeysBasic = Label(
          self.frameKeySeqBasic,
          justify=LEFT,
          textvariable=self.keyString,
          relief=GROOVE,
          borderwidth=2,
      )
      labelKeysBasic.pack(ipadx=5, ipady=5, fill=X)
      self.modifier_checkbuttons = {}
      column = 0
      for modifier, variable in zip(self.modifiers, self.modifier_vars):
          label = self.modifier_label.get(modifier, modifier)
          check = Checkbutton(
              self.frameControlsBasic,
              command=self.BuildKeyString,
              text=label,
              variable=variable,
              onvalue=modifier,
              offvalue="",
          )
          check.grid(row=0, column=column, padx=2, sticky=W)
          self.modifier_checkbuttons[modifier] = check
          column += 1
      labelFnAdvice = Label(
          self.frameControlsBasic,
          justify=LEFT,
          text="Select the desired modifier keys\n"
          + "above, and the final key from the\n"
          + "list on the right.\n\n"
          + "Use upper case Symbols when using\n"
          + "the Shift modifier.  (Letters will be\n"
          + "converted automatically.)",
      )
      labelFnAdvice.grid(
          row=1, column=0, columnspan=4, padx=2, sticky=W
      )
      self.listKeysFinal = Listbox(
          self.frameControlsBasic,
          width=15,
          height=10,
          selectmode=SINGLE,
      )
      self.listKeysFinal.bind(
          "<ButtonRelease-1>", self.FinalKeySelected
      )
      self.listKeysFinal.grid(row=0, column=4, rowspan=4, sticky=NS)
      scrollKeysFinal = Scrollbar(
          self.frameControlsBasic,
          orient=VERTICAL,
          command=self.listKeysFinal.yview,
      )
      self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set)
      scrollKeysFinal.grid(row=0, column=5, rowspan=4, sticky=NS)
      self.buttonClear = Button(
          self.frameControlsBasic,
          text="Clear Keys",
          command=self.ClearKeySeq,
      )
      self.buttonClear.grid(row=2, column=0, columnspan=4)
      labelTitleAdvanced = Label(
          self.frameKeySeqAdvanced,
          justify=LEFT,
          text="Enter new binding(s) for  '"
          + self.action
          + "' :\n"
          + "(These bindings will not be checked for validity!)",
      )
      labelTitleAdvanced.pack(anchor=W)
      self.entryKeysAdvanced = Entry(
          self.frameKeySeqAdvanced, textvariable=self.keyString
      )
      self.entryKeysAdvanced.pack(fill=X)
      labelHelpAdvanced = Label(
          self.frameHelpAdvanced,
          justify=LEFT,
          text="Key bindings are specified using Tkinter keysyms as\n"
          + "in these samples: <Control-f>, <Shift-F2>, <F12>,\n"
          "<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.\n"
          "Upper case is used when the Shift modifier is present!\n\n"
          + "'Emacs style' multi-keystroke bindings are specified as\n"
          + "follows: <Control-x><Control-y>, where the first key\n"
          + "is the 'do-nothing' keybinding.\n\n"
          + "Multiple separate bindings for one action should be\n"
          + "separated by a space, eg., <Alt-v> <Meta-v>.",
      )
      labelHelpAdvanced.grid(row=0, column=0, sticky=NSEW)
  
file_path: catboost/contrib/tools/python/src/Lib/idlelib/keybindingDialog.py
imports: from Tkinter import *
  import tkMessageBox
  import string
  import sys
label_desc: Use image node_id 2 for calling the GetKeysDialog obj's underlying member method code with example usage: obj.CreateWidgets() without return types