Re: Cursor position - Deletion of Text.



On Mon, 28 Aug 2000, Mark Leisher wrote:

> 
>     Henry> 1 - How do I get the cursor in a particular position: I have a pop
>     Henry> up window with a form, and the cursor has to be in a particular
>     Henry> entry.  This has to be built in, no keyboard or mouse.
> 
> gtk_request_focus(widget)

 No, gtk_widget_grab_focus(widget) AFAIR.

>     Henry> 2 - I have a GtkText that has some text in it that I got some
>     Henry> way. I need to press a button and have the text disappear and the
>     Henry> widget be ready to receive a new text. All this in the program, no
>     Henry> human intervention by keyboard or mouse.
> 
> [Note: I haven't actually tried this, but it should work]
> gtk_editable_delete_text(GTK_EDITABLE(text_widget), 0, 2000000)

 gtk_editable_delete_text(GTK_EDITABLE(text_widget), 0, -1) will be more
reliable.

 Best regards,
  -Vlad






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]