127 self.mainwindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
128 self.mainwindow.set_title(
'Em Calculator')
129 self.mainwindow.set_position(gtk.WIN_POS_MOUSE)
130 self.mainwindow.set_default_size(500, 300)
131 self.mainwindow.connect(
'delete-event',
lambda w,d: gtk.main_quit())
132 self.mainwindow.connect(
'destroy-event',
lambda w,d: gtk.main_quit())
135 header = self.create_header()
137 particle_frame = self.create_particle_frame()
138 particle_frame.set_border_width(self.__margin)
140 material_frame = self.create_material_frame()
141 material_frame.set_border_width(self.__margin)
143 separator = gtk.HSeparator()
145 action_box = self.create_action_box()
146 action_box.set_border_width(self.__margin)
150 vbox.pack_start(header)
151 vbox.pack_start(particle_frame)
152 vbox.pack_start(material_frame)
153 vbox.pack_start(separator)
154 vbox.pack_start(action_box)
156 self.mainwindow.add(vbox)
157 self.mainwindow.show_all()
160 self.textview = TextView()
163 self.error_dialog = gtk.MessageDialog(parent=self.mainwindow,
164 buttons=gtk.BUTTONS_CLOSE, type=gtk.MESSAGE_ERROR,
165 message_format=
"Material is not defined in G4Nist materials")
166 self.error_dialog.connect(
"response", self.cb_close_dialog)