/[ascend]/trunk/pygtk/infodialog.py
ViewVC logotype

Contents of /trunk/pygtk/infodialog.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 737 - (show annotations) (download) (as text)
Wed Jul 5 12:36:29 2006 UTC (17 years, 10 months ago) by johnpye
File MIME type: text/x-python
File size: 1188 byte(s)
DSG model converges, using 3 external functions :-)
Added more info in 'diagnose' varinfo and relinfo popups, plus tabstops in display.
Allowed parameters to be used with instantiation_error in instantiate.c.
Fixed up some error messages in bintoken.c.
Renamed 'newcalc_done' to 'evaluation_required' in rel.c.
Other minor changes to error messages and commenting.

1 # General-purpose popup window for reporting texty stuff
2
3 import gtk, gtk.glade, pango
4 import ascpy
5 from varentry import *
6
7 class InfoDialog:
8 def __init__(self,browser,parent,text,title,tabs=None):
9 self.browser = browser;
10
11 # GUI config
12 _xml = gtk.glade.XML(browser.glade_file,"infodialog")
13 self.window = _xml.get_widget("infodialog")
14 self.window.set_title(title)
15
16 if self.browser.icon:
17 self.window.set_icon(self.browser.icon)
18
19 self.parent = None
20 if parent:
21 self.parent = parent
22 self.window.set_transient_for(self.parent)
23
24 self.textview = _xml.get_widget("textview")
25 self.closebutton = _xml.get_widget("closebutton")
26
27 if tabs:
28 self.setTabs(*tabs)
29
30 self.textbuff = gtk.TextBuffer();
31 self.textview.set_buffer(self.textbuff)
32
33 self.fill_values(text)
34 _xml.signal_autoconnect(self)
35
36 def setTabs(self,*args):
37 n = len(args)
38 t = pango.TabArray(n,True)
39 i = 0
40 for v in args:
41 t.set_tab(i,pango.TAB_LEFT,v)
42 i+=1;
43 self.textview.set_tabs(t)
44
45 def fill_values(self,text):
46 self.textbuff.set_text(text);
47
48 def on_infodialog_close(self,*args):
49 self.window.response(gtk.RESPONSE_CLOSE);
50
51 def run(self):
52 self.window.run()
53 self.window.hide()

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22