On Thu, Mar 30, 2000 at 11:18:03AM -0300, Ricardo Kohler Costa wrote:
...
> I am trying to insert a text from a entry in a text(box), but I have to
> say the lenght of the text to be inserted. How can I get it???
...
>         char *texto;
...
>         texto = (gtk_entry_get_text(entry1));
>         gtk_text_insert(text1,NULL,NULL,NULL,texto, ????????????);
                                                      -1
>         gtk_entry_set_text(entry1,"");
...

  Simply put '-1' value to "gint nchars" parameter of gtk_text_insert(). In
gtk+-*/gtk/gtktext.c is:

--------------------------------------------
void
gtk_text_insert (GtkText    *text,
...
                 const char *chars,
                 gint        nchars)
...
  if (nchars < 0)
    length = strlen (chars);
  else
    length = nchars;
--------------------------------------------

  You can also give 'strlen(texto)' there but '-1' is simply less keyboard
presses for you. :-)

PS: This posting (unfortunately like a lot of other) would be more appropriate
    for <[EMAIL PROTECTED]>.


-- 
Jan Kratochvil
software developer
--------------------------------------------------------------------------
SuSE CR, s.r.o.                                 e-mail: [EMAIL PROTECTED]
Pod Pekarnami 338/12                            GSM phone: +420 602 431329
190 00 Prague 9 - Vysocany                      company:   +420 2 6603 2619
Czech Republic                                  http://www.suse.cz
--------------------------------------------------------------------------

+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.

Reply via email to