def create_toolbutton(entries, parent=None):
btn = QtGui.QToolButton(parent)<EOL>menu = QtGui.QMenu()<EOL>actions = []<EOL>for label, slot in entries:<EOL><INDENT>action = add_menu_action(menu, label, slot)<EOL>actions.append(action)<EOL><DEDENT>btn.setPopupMode(QtGui.QToolButton.MenuButtonPopup)<EOL>btn.setDefaultAction(actions[<NUM_LIT:0>])<EOL>btn.setMenu(menu)<EOL>return btn, actions<EOL>
Create a toolbutton.

    Args:
        entries: List of (label, slot) tuples.

    Returns:
        `QtGui.QToolBar`.