def showImage():
    """Display an image file."""
    global viewer
    fn = draw.askFilename(filter=utils.fileDescription('img'),multi=False,exist=True)
    if fn:
        viewer = ImageViewer(GD.app,fn)
        viewer.show()
def showImage():
    """Display an image file."""
    global viewer
    fn = draw.askFilename(filter=utils.fileDescription('img'))
    if fn:
        viewer = ImageViewer(pf.app,fn)
        viewer.show()
Example #3
0
def recordSession(stop=0):
    """Record the current pyFormex session."""
    global _recording_pid
    from guimain import hasDRI

    print("RECORDING with dri=%s" % pf.options.dri)

    ok = utils.checkExternal('recordmydesktop')
    if not ok:
        return
    if hasDRI():
        if not draw.ack("Recording the session while using DRI may fail to correctly capture the OpenGL canvas. We recommend starting pyformex with the --nodri option to do session recording (at the expense of a slower execution). If you click YES I will nevertheless go ahead with recording."):
            return

    fn = draw.askFilename(pf.cfg['workdir'],"Theora video files (*.ogv)",exist=False)
    if not fn:
        return

    print("Recording your session to file %s" % fn)
    x,y,w,h = pf.GUI.XGeometry()
    cmd = "recordmydesktop -x %s -y %s --width %s --height %s --no-frame -o %s" % (x,y,w,h,fn)
    print(cmd)
    pid = utils.spawn(cmd)
    print("Recording pid = %s" % pid)
    _recording_pid = pid
Example #4
0
def recordSession(stop=0):
    """Record the current pyFormex session."""
    global _recording_pid
    from guimain import hasDRI

    print("RECORDING with dri=%s" % pf.options.dri)

    ok = utils.checkExternal('recordmydesktop')
    if not ok:
        return
    if hasDRI():
        if not draw.ack(
                "Recording the session while using DRI may fail to correctly capture the OpenGL canvas. We recommend starting pyformex with the --nodri option to do session recording (at the expense of a slower execution). If you click YES I will nevertheless go ahead with recording."
        ):
            return

    fn = draw.askFilename(pf.cfg['workdir'],
                          "Theora video files (*.ogv)",
                          exist=False)
    if not fn:
        return

    print("Recording your session to file %s" % fn)
    x, y, w, h = pf.GUI.XGeometry()
    cmd = "recordmydesktop -x %s -y %s --width %s --height %s --no-frame -o %s" % (
        x, y, w, h, fn)
    print(cmd)
    pid = utils.spawn(cmd)
    print("Recording pid = %s" % pid)
    _recording_pid = pid
Example #5
0
def showImage():
    """Display an image file."""
    global viewer
    fn = draw.askFilename(filter=utils.fileDescription('img'))
    if fn:
        viewer = ImageViewer(pf.app, fn)
        viewer.show()
def saveIcon():
    """Save an image as icon.

    This will show the Save Image dialog, with the multisave mode off and
    asking for an icon file name. Then save the current rendering to that file.
    """
    ## We should create a specialized input dialog, asking also for the size 
    fn = draw.askFilename(filter=utils.fileDescription('icon'))
    if fn:
        image.saveIcon(fn,size=32)
Example #7
0
def openLogFile():
    fn = draw.askFilename(filter=["*.log", "*"], multi=False)
    if fn:
        closeLogFile()
        draw.logfile = file(fn, "w")
Example #8
0
def saveBoard():
    fn = draw.askFilename(filter=['*.txt', '*'], multi=False, exist=False)
    if fn:
        pf.GUI.board.save(fn)
Example #9
0
def openLogFile():
    fn = draw.askFilename(filter=['*.log', '*'], multi=False)
    if fn:
        closeLogFile()
        draw.logfile = open(fn, 'w')
Example #10
0
def saveBoard():
    fn = draw.askFilename(filter=['*.txt','*'],multi=False,exist=False)
    if fn:
        pf.GUI.board.save(fn)
Example #11
0
def openLogFile():
    fn = draw.askFilename(filter=['*.log','*'],multi=False)
    if fn:
        closeLogFile()
        draw.logfile = open(fn,'w')
Example #12
0
def saveBoard():
    fn = draw.askFilename(filter=["*.txt", "*"], multi=False, exist=False)
    if fn:
        pyformex.GUI.board.save(fn)