当前位置: 首页>>代码示例>>Python>>正文


Python Application.build_window方法代码示例

本文整理汇总了Python中miro.frontends.widgets.application.Application.build_window方法的典型用法代码示例。如果您正苦于以下问题:Python Application.build_window方法的具体用法?Python Application.build_window怎么用?Python Application.build_window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在miro.frontends.widgets.application.Application的用法示例。


在下文中一共展示了Application.build_window方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: build_window

# 需要导入模块: from miro.frontends.widgets.application import Application [as 别名]
# 或者: from miro.frontends.widgets.application.Application import build_window [as 别名]
    def build_window(self):
        self._set_default_icon()
        Application.build_window(self)
        self.window.connect('save-dimensions', self.set_main_window_dimensions)
        self.window.connect('save-maximized', self.set_main_window_maximized)

        # handle maximized
        maximized = self.get_main_window_maximized()
        if maximized != None:
            if maximized:
                self.window._window.maximize()
            else:
                self.window._window.unmaximize()

        # handle the trayicon
        self.trayicon = trayicon.Trayicon('miro')
        if app.config.get(options.SHOW_TRAYICON):
            self.trayicon.set_visible(True)
        else:
            self.trayicon.set_visible(False)

        # check x, y to make sure the window is visible and fix it
        # if not
        self.window.check_position_and_fix()

        # handle media keys
        self.mediakeyhandler = mediakeys.get_media_key_handler(self.window)
开发者ID:nxmirrors,项目名称:miro,代码行数:29,代码来源:application.py

示例2: build_window

# 需要导入模块: from miro.frontends.widgets.application import Application [as 别名]
# 或者: from miro.frontends.widgets.application.Application import build_window [as 别名]
    def build_window(self):
        icopath = self._get_icon_location()
        Application.build_window(self)
        self.window.connect('save-dimensions', self.set_main_window_dimensions)
        self.window.connect('save-maximized', self.set_main_window_maximized)

        maximized = self.get_main_window_maximized()
        if maximized != None:
            if maximized:
                self.window._window.maximize()
            else:
                self.window._window.unmaximize()

        self.trayicon = trayicon.Trayicon(icopath)
        if app.config.get(options.SHOW_TRAYICON):
            self.trayicon.set_visible(True)
        else:
            self.trayicon.set_visible(False)

        if app.config.get(options.WINDOW_DIMENSIONS) == "":
            # Miro is being started for the first time on this computer
            # so we do some figuring to make sure the default width/height
            # fit on this monitor.
            geom = self.window.get_monitor_geometry()
            width = min(1024, geom.width)
            height = min(600, geom.height)
            self.window.set_frame(width=width, height=height)
        else:
            # check x, y to make sure the window is visible and fix it
            # if not
            self.window.check_position_and_fix()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:33,代码来源:application.py

示例3: build_window

# 需要导入模块: from miro.frontends.widgets.application import Application [as 别名]
# 或者: from miro.frontends.widgets.application.Application import build_window [as 别名]
    def build_window(self):
        self._set_default_icon()
        Application.build_window(self)
        self.window.connect('save-dimensions', self.set_main_window_dimensions)
        self.window.connect('save-maximized', self.set_main_window_maximized)

        # handle maximized
        maximized = self.get_main_window_maximized()
        if maximized != None:
            if maximized:
                self.window._window.maximize()
            else:
                self.window._window.unmaximize()

        # handle the trayicon
        if APP_INDICATOR_SUPPORT:
            self.trayicon = miroappindicator.MiroAppIndicator('miro')
        else:
            self.trayicon = trayicon.Trayicon('miro')

        if app.config.get(options.SHOW_TRAYICON):
            self.trayicon.set_visible(True)
        else:
            self.trayicon.set_visible(False)

        if options.override_dimensions:
            # if the user specified override dimensions on the command
            # line, set them here.
            self.window.set_frame(
                width=options.override_dimensions[0],
                height=options.override_dimensions[1])

        elif not get_int("width") and not get_int("height"):
            # if this is the first time Miro has been started, we want
            # to set a default size that makes sense in the context of
            # their monitor resolution.  the check here is against
            # whether there are width/height values in gconf already
            # which isn't true in a first-run situation.
            geom = self.window.get_monitor_geometry()
            width = min(1024, geom.width)
            height = min(600, geom.height)
            self.window.set_frame(width=width, height=height)

        else:
            # the user isn't overriding dimensions and this is not the
            # first time Miro has been launched on this computer, so
            # we double-check that the position works on this monitor
            # and if it puts Miro in a bad place, then fix it.
            self.window.check_position_and_fix()

        # handle media keys
        self.mediakeyhandler = mediakeys.get_media_key_handler(self.window)
开发者ID:theeternalsw0rd,项目名称:miro,代码行数:54,代码来源:application.py

示例4: build_window

# 需要导入模块: from miro.frontends.widgets.application import Application [as 别名]
# 或者: from miro.frontends.widgets.application.Application import build_window [as 别名]
    def build_window(self):
        icopath = self._set_default_icon()
        Application.build_window(self)
        self.window.connect('save-dimensions', self.set_main_window_dimensions)
        self.window.connect('save-maximized', self.set_main_window_maximized)

        maximized = self.get_main_window_maximized()
        if maximized != None:
            if maximized:
                self.window._window.maximize()
            else:
                self.window._window.unmaximize()

        self.trayicon = trayicon.Trayicon(icopath)
        if app.config.get(options.SHOW_TRAYICON):
            self.trayicon.set_visible(True)
        else:
            self.trayicon.set_visible(False)

        # check x, y to make sure the window is visible and fix it if
        # not
        self.window.check_position_and_fix()
开发者ID:cool-RR,项目名称:Miro,代码行数:24,代码来源:application.py


注:本文中的miro.frontends.widgets.application.Application.build_window方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。