When you right-click to display the popup windows, you have to select an option in the menu to close it.
To avoid this, you need to use tk_popup instead of post.
You could modify these lines:
chat_box.bind(_right_click, lambda e: chat_box_menu.post(e.x_root, e.y_root))
inner_label.bind(_right_click, lambda e: _right_menu.post(e.x_root, e.y_root))
To:
chat_box.bind(_right_click, lambda e: chat_box_menu.tk_popup(e.x_root, e.y_root))
inner_label.bind(_right_click, lambda e: _right_menu.tk_popup(e.x_root, e.y_root))
When you right-click to display the popup windows, you have to select an option in the menu to close it.
To avoid this, you need to use
tk_popupinstead ofpost.You could modify these lines:
chat_box.bind(_right_click, lambda e: chat_box_menu.post(e.x_root, e.y_root))
inner_label.bind(_right_click, lambda e: _right_menu.post(e.x_root, e.y_root))
To:
chat_box.bind(_right_click, lambda e: chat_box_menu.tk_popup(e.x_root, e.y_root))inner_label.bind(_right_click, lambda e: _right_menu.tk_popup(e.x_root, e.y_root))