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


Python Interface.modeFullscreen方法代码示例

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


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

示例1: ImageViewer

# 需要导入模块: from Interface import Interface [as 别名]
# 或者: from Interface.Interface import modeFullscreen [as 别名]
class ImageViewer():
  
  def __init__(self, config_folder):
    self.config_folder = config_folder
    if not os.path.exists(self.config_folder):
      os.mkdir(self.config_folder)
    self.loadConfig()
    self.setupInterface()
    self.current_image = None
    self.files_in_folder = []
    # Inotify
    if INOTIFY:
      self.has_inotify = True
      self.pyinotify_wm = pyinotify.WatchManager()
      self.pyinotify_mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO
      handler = InotifyEventHandler(self)
      self.pyinotify_notifier = pyinotify.Notifier(self.pyinotify_wm, handler, timeout=INOTIFY_TIMEOUT)
      self.pyinotify_wdd = {}
    else:
      self.has_inotify = False
  
  def loadConfig(self):
    self.config = configparser.SafeConfigParser(DEFAULT_CONFIG)
    self.config_file = os.path.join(self.config_folder, 'config.txt')
    self.config.read(self.config_file)
  
  def getConfig(self, param):
    return self.config.get(CONFIG_SECTION_DEFAULT, param)
  
  def getConfigInt(self, param):
    return int(self.config.get(CONFIG_SECTION_DEFAULT, param))
  
  def getConfigColour(self, param):
    col_str = self.getConfig(param)
    colour = Gdk.RGBA()
    colour.parse(col_str)
    return colour
  
  def getConfigBool(self, param):
    if self.config.get(CONFIG_SECTION_DEFAULT, param).lower() == 'true':
      return True
    else:
      return False
  
  def setConfig(self, param, value):
    self.config[CONFIG_SECTION_DEFAULT][param] = str(value)
  
  def saveConfig(self):
    self.config.write(open(self.config_file, 'w'))
  
  def setupInterface(self):
    width = self.getConfigInt(CONFIG_WINDOW_WIDTH)
    height = self.getConfigInt(CONFIG_WINDOW_HEIGHT)
    request_size = (width, height)
    self.interface = Interface(self)
    self.interface.resize(request_size)
    if self.getConfigBool(CONFIG_WINDOW_FULLSCREEN):
      self.interface.modeFullscreen(True)
    self.interface.show()
  
  ## CONFIG INTERFACE GET
  def getInterfaceBGColour(self):
    return self.getConfigColour(CONFIG_BG_COLOUR)
  
  def isInterfaceImageBGPattern(self):
    return self.getConfig(CONFIG_IMAGE_BG_TYPE) == IMAGE_BG_TYPE_PATTERN
  
  def isInterfaceImageBGAsMain(self):
    return self.getConfig(CONFIG_IMAGE_BG_TYPE) == IMAGE_BG_TYPE_AS_APP
  
  def isInterfaceImageBGColour(self):
    return self.getConfig(CONFIG_IMAGE_BG_TYPE) == IMAGE_BG_TYPE_COLOUR
  
  def getInterfaceImageBGColour(self):
    return self.getConfigColour(CONFIG_IMAGE_BG_COLOUR)
  
  ## CONFIG INTERFACE SET
  def setInterfaceBGColour(self, colour):
    self.setConfig(CONFIG_BG_COLOUR, colour.to_string())
    
  def setInterfaceImageBGTypePattern(self):
    self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_PATTERN)
  
  def setInterfaceImageBGTypeAsMain(self):
    self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_AS_APP)
  
  def setInterfaceImageBGTypeColour(self):
    self.setConfig(CONFIG_IMAGE_BG_TYPE, IMAGE_BG_TYPE_COLOUR)
  
  def setInterfaceImageBGColour(self, colour):
    self.setConfig(CONFIG_IMAGE_BG_COLOUR, colour.to_string())
  
  ## START
  def start(self, imagepath=None):
    if imagepath is not None:
      current_folder = os.path.dirname(imagepath)
      self.files_in_folder = self.readFolder(current_folder)
      self.current_image = self.openImage(imagepath)
      self.inotifyAdd(current_folder)
      self.setCurrentImagePosition()
#.........这里部分代码省略.........
开发者ID:fdibaldassarre,项目名称:iw-image-viewer,代码行数:103,代码来源:ImageViewer.py


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