ESC out of desktop-session-exit.py

Forum Forums antiX-development Development ESC out of desktop-session-exit.py

  • This topic has 2 replies, 2 voices, and was last updated Sep 17-3:29 pm by anti-apXos.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #116737
    Member
    anti-apXos

      I’d like to be able to hit ESC to close the window with shutdown/pm options if I bring it up, but then don’t choose an option.

      I’ve already made some other changes to add some options, so I’m comfortable with editing the file. I just don’t know how to make it close with ESC key. Or even if it’s possible.

      #116763
      Member
      sybok

        Apart from clicking on the buttons in the top-right corner, I use the typical shortcut Alt+F4 (if you have re-defined the shortcuts, it may differ) to close it.

        #117042
        Member
        anti-apXos

          Thanks, but using ESC is easier and more consistent for me.

          The solution I found is to make the window a Gtk.Dialog instead of a Gtk.Window. Dialogs can be closed with ESC by default.

          Change
          class mainWindow(Gtk.Window):
          to
          class mainWindow(Gtk.Dialog):

          Since Gtk.Dialogs already have a widget on them and can only have one, you’ll also need to pack the button grid to the existing content area instead placing it directly. This means commenting out:

          # self.add(self.grid)
          and adding underneath it

                  self.content = self.get_content_area()
                  self.content.add(self.grid)
          

          The resulting window looks the same as the original, but this one can be closed with ESC.

          • This reply was modified 10 months ago by anti-apXos.
        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.