:param form: a window class :type form: (Window) :param containing_frame: ??? :type containing_frame: ??? :param toplevel_form: ??? :type toplevel_form: (Window)
(form, containing_frame, toplevel_form)
| 15584 | |
| 15585 | # @_timeit |
| 15586 | def PackFormIntoFrame(form, containing_frame, toplevel_form): |
| 15587 | """ |
| 15588 | |
| 15589 | :param form: a window class |
| 15590 | :type form: (Window) |
| 15591 | :param containing_frame: ??? |
| 15592 | :type containing_frame: ??? |
| 15593 | :param toplevel_form: ??? |
| 15594 | :type toplevel_form: (Window) |
| 15595 | |
| 15596 | """ |
| 15597 | |
| 15598 | # Old bindings |
| 15599 | def yscroll_old(event): |
| 15600 | if VarHolder.canvas_holder is None: |
| 15601 | return |
| 15602 | if VarHolder.canvas_holder.yview() == (0.0, 1.0): |
| 15603 | return |
| 15604 | try: |
| 15605 | if event.num == 5 or event.delta < 0: |
| 15606 | VarHolder.canvas_holder.yview_scroll(1, "unit") |
| 15607 | elif event.num == 4 or event.delta > 0: |
| 15608 | VarHolder.canvas_holder.yview_scroll(-1, "unit") |
| 15609 | except: |
| 15610 | pass |
| 15611 | |
| 15612 | def xscroll_old(event): |
| 15613 | if VarHolder.canvas_holder is None: |
| 15614 | return |
| 15615 | if VarHolder.canvas_holder.xview() == (0.0, 1.0): |
| 15616 | return |
| 15617 | try: |
| 15618 | if event.num == 5 or event.delta < 0: |
| 15619 | VarHolder.canvas_holder.xview_scroll(1, "unit") |
| 15620 | elif event.num == 4 or event.delta > 0: |
| 15621 | VarHolder.canvas_holder.xview_scroll(-1, "unit") |
| 15622 | except: |
| 15623 | pass |
| 15624 | |
| 15625 | # Chr0nic |
| 15626 | def testMouseHook2(em): |
| 15627 | combo = em.TKCombo |
| 15628 | combo.unbind_class("TCombobox", "<MouseWheel>") |
| 15629 | combo.unbind_class("TCombobox", "<ButtonPress-4>") |
| 15630 | combo.unbind_class("TCombobox", "<ButtonPress-5>") |
| 15631 | containing_frame.unbind_all('<4>') |
| 15632 | containing_frame.unbind_all('<5>') |
| 15633 | containing_frame.unbind_all("<MouseWheel>") |
| 15634 | containing_frame.unbind_all("<Shift-MouseWheel>") |
| 15635 | |
| 15636 | # Chr0nic |
| 15637 | def testMouseUnhook2(em): |
| 15638 | containing_frame.bind_all('<4>', yscroll_old, add="+") |
| 15639 | containing_frame.bind_all('<5>', yscroll_old, add="+") |
| 15640 | containing_frame.bind_all("<MouseWheel>", yscroll_old, add="+") |
| 15641 | containing_frame.bind_all("<Shift-MouseWheel>", xscroll_old, add="+") |
| 15642 | |
| 15643 | # Chr0nic |
no test coverage detected