2013-05-06 1 views
0

파이썬에서 프론트 엔드를 만드는 솔루션을 찾고 있습니다. 나는 Tk에 대한 경험이있다. (그러나 wxpython을 사용하고 싶지 않다.) 표준 위젯이지만, 지금은 나에게 너무 복잡한 프로젝트에있다. 앱은 멀티미디어 프리젠 테이션 빌더 또는 스케줄러와 같습니다. 여기서 사용할 수있는 요소는 그림, 비디오, 소리 및 기타 명령을 실행하는 명령이고, 각 요소를 볼 때 언제 시작해야 할지를 결정합니다. 내가, 내가 멀티 트랙 오디오 또는 비디오 편집기 유사한 인터페이스의 모형을 만들었 그래서 , 표준 위젯을 사용할 수없는 한파이썬에서 트랙과 타임 라인이있는 프론트 엔드 빌드

모형 이미지가 http://tinypic.com/r/4gqnap/5

당신 그림에서 내 아이디어를 볼 수 있습니다. 그림, 비디오, 직렬 명령 및 foreach와 같은 다른 개체를 넣을 수있는 채널이 있습니다. 시작할 시간과 지속 시간을 설정할 수 있습니다. 내가 재생을 누르면 타임 라인 커서가 이동하고 채널의 객체 시작 지점에 도달하면 객체가 비디오를 보거나 실행하기 위해 "시작"합니다. 나는 내가 플레이 중일 때 타임 라인 스크롤을 제어 할 수 있으며, 채널 스크롤을 통해 필요한 채널 수를 추가 할 수 있습니다. 그림과 비디오는 다른 전용 프레임에서 볼 수 있습니다. 각 채널은 프레임을 나타냅니다. 아이디어를 얻을 수있는 유사한 프런트 엔트가 있습니까? 또는 그것 같이 무언가를 건축하는 방법에 지시?

감사합니다.

조르지오

답변

0

이는 .. extreeemely 막연한 질문이다 그러나 여기서 우리는 ... 나는 전통적인 모듈의 대부분을 건너 뛸 것 (예 : TK에 또는 wxPython을 등을하지만 그들은 당신을 위해 일할 수있는) 이동합니다.

나는 보통 여기

짧은 드래그 앤 드롭 예입니다 .. GUI 개발이나 현명한 그래픽 것도 흥미로운 사람에게 Pyglet 옵션을 제공 : 여기

#!/usr/bin/python 
import pyglet 
from time import time, sleep 

class Window(pyglet.window.Window): 
    def __init__(self, refreshrate): 
     super(Window, self).__init__(vsync = False) 
     self.frames = 0 
     self.framerate = pyglet.text.Label(text='Unknown', font_name='Verdana', font_size=8, x=10, y=10, color=(255,255,255,255)) 
     self.last = time() 
     self.alive = 1 
     self.refreshrate = refreshrate 
     self.click = None 
     self.drag = False 

    def on_draw(self): 
     self.render() 

    def on_mouse_press(self, x, y, button, modifiers): 
     self.click = x,y 

    def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers): 
     if self.click: 
      self.drag = True 
      print 'Drag offset:',(dx,dy) 

    def on_mouse_release(self, x, y, button, modifiers): 
     if not self.drag and self.click: 
      print 'You clicked here', self.click, 'Relese point:',(x,y) 
     else: 
      print 'You draged from', self.click, 'to:',(x,y) 
     self.click = None 
     self.drag = False 

    def render(self): 
     self.clear() 
     if time() - self.last >= 1: 
      self.framerate.text = str(self.frames) 
      self.frames = 0 
      self.last = time() 
     else: 
      self.frames += 1 
     self.framerate.draw() 
     self.flip() 

    def on_close(self): 
     self.alive = 0 

    def run(self): 
     while self.alive: 
      self.render() 
      # ----> Note: <---- 
      # Without self.dispatc_events() the screen will freeze 
      # due to the fact that i don't call pyglet.app.run(), 
      # because i like to have the control when and what locks 
      # the application, since pyglet.app.run() is a locking call. 
      event = self.dispatch_events() 
      sleep(1.0/self.refreshrate) 

win = Window(23) # set the fps 
win.run() 

당신이 만들어야 할 것이다 자신의 개체 (텍스트 상자, 슬라이더 .. 등)하지만 전체 제어 할 수 있습니다.

몇 가지 (8-13) 개의 대규모 GUI 응용 프로그램을 만들었으며 벽돌 모양 버튼과 일반 색상 표를 사용하지 않으려는 경우 가장 깨끗한 방법입니다. 또한

, GUI 토론에이 스레드와 더 많은 참조 최고의 모듈 등 무엇 : http://wiki.python.org/moin/GuiProgramming

  • Game Development in Python, ruby or LUA?
  • Curses alternative for windows

    • (내가 멀리 주어진 것을 알고 다른 코드)

    그리고 Pyglet에 대한

  • :