hggtk/gdialog.py
changeset 1182 cbe418752174
parent 1166 94abe456eaab
equal deleted inserted replaced
1181:ab9654ce0550 1182:cbe418752174
   277         self.tooltips = gtk.Tooltips()
   277         self.tooltips = gtk.Tooltips()
   278         toolbar = gtk.Toolbar()
   278         toolbar = gtk.Toolbar()
   279         tbuttons =  self.get_tbbuttons()
   279         tbuttons =  self.get_tbbuttons()
   280         for tbutton in tbuttons:
   280         for tbutton in tbuttons:
   281             toolbar.insert(tbutton, -1)
   281             toolbar.insert(tbutton, -1)
   282         sep = gtk.SeparatorToolItem()
       
   283         sep.set_expand(True)
       
   284         sep.set_draw(False)
       
   285         toolbar.insert(sep, -1)
       
   286         if self.main:
       
   287             name = 'Quit'
       
   288             tip = 'Close Application'
       
   289         else:
       
   290             name = 'Close'
       
   291             tip = 'Close Window'
       
   292         button = self.make_toolbutton(gtk.STOCK_CLOSE, name,
       
   293                 self._quit_clicked, tip=tip)
       
   294         toolbar.insert(button, -1)
       
   295         self.toolbar = toolbar
   282         self.toolbar = toolbar
   296         vbox.pack_start(toolbar, False, False, 0)
   283         vbox.pack_start(toolbar, False, False, 0)
   297 
   284 
   298         # Subclass returns the main body
   285         # Subclass returns the main body
   299         body = self.get_body()
   286         body = self.get_body()
   309             hbox.pack_start(gtk.Label(''), True, True)
   296             hbox.pack_start(gtk.Label(''), True, True)
   310             vbox.pack_end(hbox, False, False, 0)
   297             vbox.pack_end(hbox, False, False, 0)
   311 
   298 
   312         self.connect('destroy', self._destroying)
   299         self.connect('destroy', self._destroying)
   313         self.connect('delete_event', self.should_live)
   300         self.connect('delete_event', self.should_live)
   314 
       
   315 
       
   316 
       
   317     def _quit_clicked(self, button, data=None):
       
   318         if not self.should_live():
       
   319             self.destroy()
       
   320 
   301 
   321 
   302 
   322     def _destroying(self, gtkobj):
   303     def _destroying(self, gtkobj):
   323         try:
   304         try:
   324             settings = self.save_settings()
   305             settings = self.save_settings()