mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
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
This commit is contained in:
parent
5a4ed10fae
commit
6257f681d2
@ -1,3 +1,8 @@
|
||||
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:
|
||||
|
@ -1,3 +1,7 @@
|
||||
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"):
|
||||
|
Loading…
Reference in New Issue
Block a user