insert_text_handler
- From: Jean-Philippe COMBE <jphcombe free fr>
- To: gtk-app-devel-list gnome org
- Subject: insert_text_handler
- Date: Mon, 29 Sep 2003 18:35:24 +0200
Hello,
I did find the folowing code in a documentation file (it was in C but i
translated it to pascal and i don't remember where is the C version).
This is a callback procedure to work with the widget "entry".
The question is : It has many parameters and i don't know how to connect it
with my entry, g_signal_connect does not accept so many parameters as i know.
Could someone send me an example please ? (in c is ok).
Thanks a lot
Jean-Philippe COMBE
PROCEDURE insert_text_handler (editable : PGtkEditable;
text : PGCHAR;
Length_ : gint;
position : Pgint;
data : gpointer); CDECL;
VAR i : INTEGER;
result : pgchar;
BEGIN
result := g_new (sizeof(gchar), length_);
FOR i := 0 TO length_-1 DO
result[i] := UpCase(text[i]);
g_signal_handlers_block_by_func (GTK_OBJECT (editable),
@insert_text_handler, data);
gtk_editable_insert_text (editable, result, length_, position);
g_signal_handlers_unblock_by_func (GTK_OBJECT (editable),
@insert_text_handler, data);
g_signal_stop_emission_by_name (GTK_OBJECT (editable), 'insert_text');
g_free (result);
END;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]