Page 1 of 1

How to display an error message to the user ?

Posted: Mon Dec 22, 2008 8:41 pm
by aalex
Hi all,
How can I display an error message to the user from Python ?
I think the proper way to do it would be to write something in red in the top right corner of the main panel.

I haven't found any information on how to do this so far.
Thanks,

Posted: Wed Dec 24, 2008 11:11 am
by sigmasix
I think in the way you want this is impossible... Currently you can print messages to the Script output (menu Modules > Script > Script Output) using the function print("Hello")

An other solution would be to add a text caption on your module and change the message in the code using

Code: Select all

module.setAttribute ('captionName','CAPTION', 'message')

Posted: Mon Dec 29, 2008 1:18 am
by zoophar
python allows to use OSA (Open scricting architecture)
it's also called apple-scritps...

see something like the module aetools aepack etc...

import aetools
print aetools.__doc__

Posted: Mon Dec 29, 2008 10:19 am
by sigmasix
ahyeah, thanks for the tip!

Posted: Tue Dec 30, 2008 11:41 pm
by zoophar
we can use it but it's deprecated
sorry :(

http://docs.python.org/library/mac.html ... e%20events

Posted: Wed Dec 31, 2008 2:36 pm
by zoophar
So i've been looking forward to display en error merrage
without adding any libs or modules to python.

i made some cow fu fighting and some googling on the web...

i've found
http://www.doughellmann.com/PyMOTW/Easy ... index.html
wich seem to be very simple... and user friendly

Code: Select all

import EasyDialogs
print EasyDialog.__doc__

prints the doc about it and all the dialog box we can use...

So, i've tested in the terminal with the first example on the page

Code: Select all

import EasyDialogs
EasyDialogs.Message('This is a Message dialog')


the appliction launcher started and it displayed the message 'this is a Message dialog' with an OK button...

then, i started M8 and copy pasted the code in a new module and started the module.

M8 freezed...
does anyone know a bit more about this?

Cheerz and happy new year!!!!!

Posted: Wed Dec 31, 2008 2:47 pm
by sigmasix
Hi, thanks for the tip!
I tried on the terminal, I discovered the python rocket, it's fun, too bad the massage doesn't come up in front...

I also tried in modul8, and like you I had the doom beachball... But also had the message... But no way to click ok... We'll see what we can do about it, either this working, or a 100% modul8 solution