Logo Search packages:      
Sourcecode: nagstamon version File versions  Download package

def Nagstamon::nagstamonGUI::Popwin::PopDown (   self,
  widget = None,
  event = None 
)

    close popwin
    when it should closed it must be checked if the pointer is outside 
    the popwin to prevent it closing when not necessary/desired

Definition at line 1144 of file nagstamonGUI.py.

01144                                               :
        """
            close popwin
            when it should closed it must be checked if the pointer is outside 
            the popwin to prevent it closing when not necessary/desired
        """
        # catch Exception
        try:
            # access to rootwindow to get the pointers coordinates
            rootwin = self.output.statusbar.StatusBar.get_screen().get_root_window()
            # get position of the pointer
            mousex, mousey, foo = rootwin.get_pointer()
            # get position of popwin
            popwinx0, popwiny0 = self.get_position()

            # actualize values for width and height
            self.popwinwidth, self.popwinheight = self.get_size()

            # If pointer is outside popwin close it
            # to support Windows(TM)'s slow and event-loosing behaviour use some margin (10px) to be more tolerant to get popwin closed
            # y-axis dooes not get extra 10 px on top for sake of combobox and x-axis on right side not because of scrollbar -
            # so i wonder if it has any use left...
            if mousex <= popwinx0 + 10 or mousex >= (popwinx0 + self.popwinwidth) or mousey <= popwiny0 or mousey >= (popwiny0 + self.popwinheight) - 10 :
                self.Close()
        except:
            pass
        

    def Close(self, widget=None):


Generated by  Doxygen 1.6.0   Back to index