"Fossies" - the Fresh Open Source Software Archive

Member "radialnet/bestwidgets/windows.py" (4 Mar 2008, 2082 Bytes) of package /linux/privat/old/radialnet-0.44.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "windows.py" see the Fossies "Dox" file reference documentation.

    1 # vim: set fileencoding=utf-8 :
    2 
    3 # Copyright (C) 2005, 2008 Insecure.Com LLC.
    4 #
    5 # Author(s): João Paulo de Souza Medeiros <ignotus21@gmail.com>
    6 #            Adriano Monteiro Marques <py.adriano@gmail.com>
    7 #            Cleber Rodrigues <cleber.gnu@gmail.com>
    8 #
    9 # This program is free software; you can redistribute it and/or modify
   10 # it under the terms of the GNU General Public License as published by
   11 # the Free Software Foundation; either version 2 of the License, or
   12 # (at your option) any later version.
   13 #
   14 # This program is distributed in the hope that it will be useful,
   15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17 # GNU General Public License for more details.
   18 #
   19 # You should have received a copy of the GNU General Public License
   20 # along with this program; if not, write to the Free Software
   21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
   22 
   23 import gtk
   24 from bestwidgets import gtk_version_minor
   25 
   26 PRIMARY_TEXT_MARKUP = '<span weight="bold" size="larger">%s</span>'
   27 
   28 
   29 
   30 class BWAlertDialog(gtk.MessageDialog):
   31     """
   32     """
   33     def __init__(self, parent=None, flags=0, type=gtk.MESSAGE_INFO,
   34                  buttons=gtk.BUTTONS_OK,
   35                  primary_text=None,
   36                  secondary_text=None):
   37         
   38         gtk.MessageDialog.__init__(self, parent, flags, type, buttons)
   39 
   40         self.connect('response', self.__destroy)
   41 
   42         self.set_resizable(False)
   43 
   44         self.set_title("Alert")
   45         self.set_markup(PRIMARY_TEXT_MARKUP % primary_text)
   46 
   47         if secondary_text:
   48 
   49             # GTK up to version 2.4 does not have secondary_text
   50             if gtk_version_minor > 4:
   51                 self.format_secondary_text(secondary_text)
   52 
   53 
   54     def __destroy(self, dialog, id):
   55         """
   56         """
   57         self.destroy()
   58 
   59 
   60 
   61 class BWWindow(gtk.Window):
   62     """
   63     """
   64     def __init__(self, type=gtk.WINDOW_TOPLEVEL):
   65         """
   66         """
   67         gtk.Window.__init__(self, type)
   68         self.set_border_width(5)
   69 
   70 
   71 BWMainWindow = gtk.Window