def __init__(self, title='MPImage', width=512, height=512, can_zoom=False, can_drag=False, mouse_events=False, key_events=False, auto_size=False, report_size_changes=False, daemon=False): import multiprocessing self.title = title self.width = width self.height = height self.can_zoom = can_zoom self.can_drag = can_drag self.mouse_events = mouse_events self.key_events = key_events self.auto_size = auto_size self.report_size_changes = report_size_changes self.menu = None self.popup_menu = None from multiprocessing_queue import makeIPCQueue self.in_queue = makeIPCQueue() self.out_queue = makeIPCQueue() self.default_menu = MPMenuSubMenu( 'View', items=[ MPMenuItem('Fit Window', 'Fit Window', 'fitWindow'), MPMenuItem('Full Zoom', 'Full Zoom', 'fullSize') ]) self.child = multiprocessing.Process(target=self.child_task) self.child.daemon = daemon self.child.start() self.set_popup_menu(self.default_menu)
def __init__(self, title='MPImage', width=512, height=512, can_zoom = False, can_drag = False, mouse_events = False, key_events = False, auto_size = False, report_size_changes = False, daemon = False): import multiprocessing self.title = title self.width = width self.height = height self.can_zoom = can_zoom self.can_drag = can_drag self.mouse_events = mouse_events self.key_events = key_events self.auto_size = auto_size self.report_size_changes = report_size_changes self.menu = None self.popup_menu = None from multiprocessing_queue import makeIPCQueue self.in_queue = makeIPCQueue() self.out_queue = makeIPCQueue() self.default_menu = MPMenuSubMenu('View', items=[MPMenuItem('Fit Window', 'Fit Window', 'fitWindow'), MPMenuItem('Full Zoom', 'Full Zoom', 'fullSize')]) self.child = multiprocessing.Process(target=self.child_task) self.child.daemon = daemon self.child.start() self.set_popup_menu(self.default_menu)