#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 22 11:46:00 2018 @author: martindrech """ from PyQt5.QtWidgets import QMessageBox def show_warning(text, details_text = ''): msg = QMessageBox() msg.setIcon(QMessageBox.Warning) msg.setText(text) msg.setWindowTitle("Oh dear") if details_text: msg.setDetailedText(details_text) msg.setStandardButtons(QMessageBox.Ok) msg.buttonClicked.connect(msgbtn) retval = msg.exec_() #print("value of pressed message box button:", retval) def msgbtn(i): print("Button pressed is:",i.text())