Commit 6257f681 authored by Johan Dahlin's avatar Johan Dahlin Committed by Johan Dahlin

Convert GtkTextView::text properties

2007-07-07  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtk-builder-convert (GtkBuilderConverter._convert_textview_text): 
    Convert GtkTextView::text properties


svn path=/trunk/; revision=18389
parent 5a4ed10f
2007-07-07 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtk-builder-convert (GtkBuilderConverter._convert_textview_text):
Convert GtkTextView::text properties
2007-07-06 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkprivate-quartz.h:
......
2007-07-07 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtk-builder-convert.xml: Update
2007-04-05 Matthias clasen <mclasen@redhat.com>
* gtk/tmpl/gtkbuilder.sgml: Pixbuf properties
......
......@@ -28,9 +28,6 @@ its output the file specified as the second argument.
<refsect1><title>Bugs</title>
<para>
GtkTextView text is not converted into a GtkTextBuffer.
</para>
<para>
Toolbars are not handled.
</para>
<para>
......
......@@ -19,7 +19,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# TODO:
# GtkTextView.text -> GtkTextBuffer
# Toolbars
"""Usage: gtk-builder-convert [OPTION] [INPUT] [OUTPUT]
......@@ -233,6 +232,8 @@ class GtkBuilderConverter(object):
elif prop_name == "items" and klass in ['GtkComboBox',
'GtkComboBoxEntry']:
self._convert_combobox_items(node, prop)
elif prop_name == "text" and klass == 'GtkTextView':
self._convert_textview_text(prop)
def _remove_window(self, node):
object_node = get_object_node(get_child_nodes(node)[0])
......@@ -442,6 +443,16 @@ class GtkBuilderConverter(object):
attribute.setAttribute('name', 'text')
attribute.appendChild(self._dom.createTextNode('0'))
def _convert_textview_text(self, prop):
data = prop.childNodes[0].data
if prop.hasAttribute('translatable'):
prop.removeAttribute('translatable')
tbuffer = self._create_object("GtkTextBuffer", None,
template='textbuffer',
text=data)
prop.childNodes[0].data = tbuffer.getAttribute('id')
self._interface.childNodes.insert(0, tbuffer)
def _packing_prop_to_child_attr(self, node, prop_name, prop_val,
attr_val=None):
for child in node.getElementsByTagName("child"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment