Created
January 4, 2015 17:45
-
-
Save carter2422/103146d81324164946b5 to your computer and use it in GitHub Desktop.
Simple Error Popup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def showErrorMessage(message, wrap=80): | |
lines = [] | |
if wrap > 0: | |
while len(message) > wrap: | |
i = message.rfind(' ',0,wrap) | |
if i == -1: | |
lines += [message[:wrap]] | |
message = message[wrap:] | |
else: | |
lines += [message[:i]] | |
message = message[i+1:] | |
if message: | |
lines += [message] | |
def draw(self,context): | |
for line in lines: | |
self.layout.label(line) | |
bpy.context.window_manager.popup_menu(draw, title="Error Message", icon="ERROR") | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment