Example #1
0
            selected_sub_item.winfo_rootx()
            + prop_window.winfo_rootx()
            - icon_widget.winfo_rootx()
        ),
        y=(
            selected_sub_item.winfo_rooty()
            + prop_window.winfo_rooty()
            - icon_widget.winfo_rooty()
        ),
        win=prop_window,
    )

    prop_window.geometry('+{x!s}+{y!s}'.format(x=loc_x, y=loc_y))

# When the main window moves, move the context window also.
TK_ROOT.bind("<Configure>", adjust_position, add='+')


def hide_context(_=None):
    """Hide the properties window, if it's open."""
    global is_open, selected_item, selected_sub_item
    if is_open:
        is_open = False
        prop_window.withdraw()
        snd.fx('contract')
        selected_item = selected_sub_item = None


def init_widgets():
    """Initiallise all the window components."""
    global prop_window
Example #2
0
    # window
    icon_widget = wid['subitem', pos_for_item()]

    loc_x, loc_y = utils.adjust_inside_screen(
        x=(selected_sub_item.winfo_rootx() + prop_window.winfo_rootx() -
           icon_widget.winfo_rootx()),
        y=(selected_sub_item.winfo_rooty() + prop_window.winfo_rooty() -
           icon_widget.winfo_rooty()),
        win=prop_window,
    )

    prop_window.geometry('+{x!s}+{y!s}'.format(x=loc_x, y=loc_y))


# When the main window moves, move the context window also.
TK_ROOT.bind("<Configure>", adjust_position, add='+')


def hide_context(e=None):
    """Hide the properties window, if it's open."""
    global is_open, selected_item, selected_sub_item
    if is_open:
        is_open = False
        prop_window.withdraw()
        snd.fx('contract')
        selected_item = selected_sub_item = None


def init_widgets():
    """Initiallise all the window components."""
    global prop_window