Exemplo n.º 1
0
def SetIcon(window,name,tooltip=""):
    """Set application icon
    window: wx.Frame object
    name: e.g. "Checklist"
    """
    filename = ""
    icon = None
    if name:
        from module_dir import module_dir
        from os.path import exists
        basename = module_dir(SetIcon)+"/icons/%s" % name
        if exists(basename+".ico"): filename = basename+".ico"
        elif exists(basename+".png"): filename = basename+".png"
        else: warn("%r.{ico,png}: neither file found" % basename)
    if filename:
        try: icon = wx.Icon(filename)
        except Exception,msg: warn("%s: %s" % (filename,msg))
    if icon:
        if window: window.Icon = icon
        try:
            if hasattr(wx,"TaskBarIcon"):
                if not hasattr(wx,"taskbar_icon"):
                    wx.taskbar_icon = wx.TaskBarIcon(iconType=wx.TBI_DOCK)
                wx.taskbar_icon.SetIcon(icon,tooltip)
        except Exception,msg: warn("%s\n%s" % (msg,traceback.format_exc()))
Exemplo n.º 2
0
def start(module, command):
    """
    module: e.g. "SavedPositionsPanel_2"
    command: e.g. "ConfigurationsPanel()"
    SavedPositionsPanel(name="methods",globals=globals(),locals=locals())
    ConfigurationPanel(name="methods",globals=globals(),locals=locals())
    ConfigurationsPanel()
    """
    from module_dir import module_dir
    directory = module_dir(start)
    from os import chdir
    try:
        chdir(directory)
    except Exception, msg:
        warn("%s: %s" % (directory, msg))
 def local_setup_dirname(self):
     from module_dir import module_dir
     return module_dir(self) + "/lecroy_scope/" + self.name
Exemplo n.º 4
0
def settings_dir():
    """Pathname of the file used to store persistent parameters"""
    from module_dir import module_dir
    path = module_dir(settings_dir) + "/settings"
    return path