Exemplo n.º 1
0
    def window_did_load(self):
        wc = self.wc
        wc.docsView.default_menu = self.menu
        wc.docsView.setRefusesFirstResponder_(True)
        wc.docsView.registerForDraggedTypes_(self.supported_drag_types)
        wc.plusButton.setRefusesFirstResponder_(True)
        wc.plusButton.setImage_(load_image(const.PLUS_BUTTON_IMAGE))
        wc.propsViewButton.setRefusesFirstResponder_(True)
        wc.propsViewButton.setImage_(load_image(const.PROPS_DOWN_BUTTON_IMAGE))
        wc.propsViewButton.setAlternateImage_(load_image(const.PROPS_UP_BUTTON_IMAGE))

        self._setstate(self._state)
        self._state = None

        if not self.projects:
            self.new_project()
Exemplo n.º 2
0
 def initWithFrame_(self, frame):
     super(MailStyleFunctioBarBackgroundView, self).initWithFrame_(frame)
     self.bgimage = load_image("docsbar-blank.png")
     return self
Exemplo n.º 3
0
 def awakeFromNib(self):
     self.setImage_(load_image("docsbar-sizer.png"))
Exemplo n.º 4
0
 def initWithFrame_(self, frame):
     super(MailStyleFunctioBarBackgroundView, self).initWithFrame_(frame)
     self.bgimage = load_image("docsbar-blank.png")
     return self
Exemplo n.º 5
0
 def awakeFromNib(self):
     self.setImage_(load_image("docsbar-sizer.png"))
Exemplo n.º 6
0
    def window_did_load(self):
        wc = self.wc
        wc.setShouldCloseDocument_(False)
        wc.docsView.setRefusesFirstResponder_(True)
        wc.plusButton.setRefusesFirstResponder_(True)
        wc.plusButton.setImage_(load_image(const.PLUS_BUTTON_IMAGE))
        wc.propsViewButton.setRefusesFirstResponder_(True)
        wc.propsViewButton.setImage_(load_image(const.PROPS_DOWN_BUTTON_IMAGE))
        wc.propsViewButton.setAlternateImage_(load_image(const.PROPS_UP_BUTTON_IMAGE))

        fn.NSNotificationCenter.defaultCenter().addObserver_selector_name_object_(
            wc, "windowDidBecomeKey:", ak.NSWindowDidBecomeKeyNotification, wc.window())
        assert hasattr(EditorWindowController, "windowDidBecomeKey_")

        wc.cleanImages = {
            BUTTON_STATE_HOVER: load_image(const.CLOSE_CLEAN_HOVER),
            BUTTON_STATE_NORMAL: load_image(const.CLOSE_CLEAN_NORMAL),
            BUTTON_STATE_PRESSED: load_image(const.CLOSE_CLEAN_PRESSED),
            BUTTON_STATE_SELECTED: load_image(const.CLOSE_CLEAN_SELECTED),
        }
        wc.dirtyImages = {
            BUTTON_STATE_HOVER: load_image(const.CLOSE_DIRTY_HOVER),
            BUTTON_STATE_NORMAL: load_image(const.CLOSE_DIRTY_NORMAL),
            BUTTON_STATE_PRESSED: load_image(const.CLOSE_DIRTY_PRESSED),
            BUTTON_STATE_SELECTED: load_image(const.CLOSE_DIRTY_SELECTED),
        }

        wc.docsView.registerForDraggedTypes_(self.supported_drag_types)

        self._setstate(self._state)
        self._state = None

        if not self.projects:
            self.new_project()
Exemplo n.º 7
0
def test_load_image():
    img = load_image("close-hover.png")
    assert isinstance(img, ak.NSImage)
Exemplo n.º 8
0
def test_load_image():
    img = load_image("close-hover.png")
    assert isinstance(img, ak.NSImage)