2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkCellRendererText.html
27 * outFile = CellRendererText
28 * strct = GtkCellRenderer
29 * realStrct=GtkCellRendererText
31 * clss = CellRendererText
39 * - gtk_cell_renderer_text_
48 * - GtkCellRenderer* -> CellRenderer
53 module gtk
.CellRendererText
;
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gtktypes
;
65 private import gtkc
.gtk
;
68 private import glib
.Str
;
69 private import gtk
.CellRenderer
;
76 * A GtkCellRendererText renders a given text in its cell, using the font, color and
77 * style information provided by its properties. The text will be ellipsized if it is
78 * too long and the ellipsize
80 * If the mode is GTK_CELL_RENDERER_MODE_EDITABLE,
81 * the GtkCellRendererText allows to edit its text using an entry.
83 private import gtk
.CellRenderer
;
84 public class CellRendererText
: CellRenderer
87 /** the main Gtk struct */
88 protected GtkCellRendererText
* gtkCellRendererText
;
91 public GtkCellRendererText
* getCellRendererTextStruct()
93 return gtkCellRendererText
;
97 /** the main Gtk struct as a void* */
98 protected void* getStruct()
100 return cast(void*)gtkCellRendererText
;
104 * Sets our main struct and passes it to the parent class
106 public this (GtkCellRendererText
* gtkCellRendererText
)
110 if ( gtkCellRendererText
is null )
115 Stdout("struct gtkCellRendererText is null on constructor").newline
;
119 printf("struct gtkCellRendererText is null on constructor");
126 assert(gtkCellRendererText
!is null, "struct gtkCellRendererText is null on constructor");
128 super(cast(GtkCellRenderer
*)gtkCellRendererText
);
129 this.gtkCellRendererText
= gtkCellRendererText
;
135 // imports for the signal processing
136 private import gobject
.Signals
;
137 private import gtkc
.gdktypes
;
138 int[char[]] connectedSignals
;
140 void delegate(char[], char[], CellRendererText
)[] onEditedListeners
;
141 void addOnEdited(void delegate(char[], char[], CellRendererText
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
143 if ( !("edited" in connectedSignals
) )
148 cast(GCallback
)&callBackEdited
,
152 connectedSignals
["edited"] = 1;
154 onEditedListeners
~= dlg
;
156 extern(C
) static void callBackEdited(GtkCellRendererText
* rendererStruct
, gchar
* path
, gchar
* newText
, CellRendererText cellRendererText
)
158 bool consumed
= false;
160 foreach ( void delegate(char[], char[], CellRendererText
) dlg
; cellRendererText
.onEditedListeners
)
162 dlg(Str
.toString(path
), Str
.toString(newText
), cellRendererText
);
171 * Creates a new GtkCellRendererText. Adjust how text is drawn using
172 * object properties. Object properties can be
173 * set globally (with g_object_set()). Also, with GtkTreeViewColumn,
174 * you can bind a property to a value in a GtkTreeModel. For example,
175 * you can bind the "text" property on the cell renderer to a string
176 * value in the model, thus rendering a different string in each row
179 * the new cell renderer
183 // GtkCellRenderer* gtk_cell_renderer_text_new (void);
184 this(cast(GtkCellRendererText
*)gtk_cell_renderer_text_new() );
188 * Sets the height of a renderer to explicitly be determined by the "font" and
189 * "y_pad" property set on it. Further changes in these properties do not
190 * affect the height, so they must be accompanied by a subsequent call to this
191 * function. Using this function is unflexible, and should really only be used
192 * if calculating the size of a cell is too slow (ie, a massive number of cells
193 * displayed). If number_of_rows is -1, then the fixed height is unset, and
194 * the height is determined by the properties again.
196 * A GtkCellRendererText
198 * Number of rows of text each cell renderer is allocated, or -1
200 * The "align-set" property
201 * "align-set" gboolean : Read / Write
202 * Whether this tag affects the alignment mode.
203 * Default value: FALSE
205 public static void setFixedHeightFromFont(GtkCellRendererText
* renderer
, int numberOfRows
)
207 // void gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer, gint number_of_rows);
208 gtk_cell_renderer_text_set_fixed_height_from_font(renderer
, numberOfRows
);