3 # GPytage window.py module
5 ############################################################################
6 # Copyright (C) 2008 by Kenneth Prugh #
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 under version 2 of the license. #
13 # This program is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 # GNU General Public License for more details. #
18 # You should have received a copy of the GNU General Public License #
19 # along with this program; if not, write to the #
20 # Free Software Foundation, Inc., #
21 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
22 ############################################################################
24 import pygtk
; pygtk
.require("2.0")
27 window
= gtk
.Window(gtk
.WINDOW_TOPLEVEL
)
30 """Set the title of the window. Used to indicate changes *"""
31 window
.set_title(text
)
33 def createMessageDialog(parent
, flags
, type, buttons
, mtitle
, message_format
):
34 md
= gtk
.MessageDialog(None, flags
, type, buttons
, message_format
)
41 Spawn Generic Yes/No/Save Dialog when unsaved changes are present.
43 YES returns -8. NO returns -9. Save returns 1.
46 uD
= gtk
.MessageDialog(parent
=None, flags
=gtk
.DIALOG_MODAL
, type=gtk
.MESSAGE_WARNING
, buttons
=gtk
.BUTTONS_YES_NO
, message_format
="You have unsaved changes, if you proceed these changes will be lost.\n\n Do you wish to continue?")
47 uD
.set_title("You have unsaved changes")
48 uD
.set_default_response(gtk
.RESPONSE_NO
)
50 uD
.add_button("_Save and Continue", 1)