1 ## This file is part of Crapvine.
3 ## Copyright (C) 2007 Andrew Sayman <lorien420@myrealbox.com>
5 ## Crapvine is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or
8 ## (at your option) any later version.
10 ## Crapvine is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
24 __text_box_xml_file
= configuration
.get_textbox_xml_file_path()
25 def __init__(self
, trait_display_name
, overlord
, character
):
26 self
.xml
= gtk
.glade
.XML(self
.__text
_box
_xml
_file
, 'textbox')
27 self
.vbox
= self
.xml
.get_widget('textbox')
28 self
.title
= self
.xml
.get_widget('lblTextBoxTitle')
29 self
.textview
= self
.xml
.get_widget('textview')
30 self
.trait_display_name
= trait_display_name
31 self
.overlord
= overlord
32 self
.character
= character
34 buffer = self
.textview
.get_buffer()
35 iter = buffer.get_start_iter()
36 buffer.insert(iter, character
[trait_display_name
])
37 buffer.connect('changed', self
.on_text_changed
)
39 self
.title
.set_label(self
.trait_display_name
.capitalize())
41 def on_text_changed(self
, textbuffer
):
42 self
.character
[self
.trait_display_name
] = textbuffer
.get_text(textbuffer
.get_start_iter(), textbuffer
.get_end_iter(), False)