Re: gtk_editable_get_position

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

 



On Tue, Dec 22, 2009 at 12:46:28PM +0100, Emmanuel Rodriguez wrote:
> On Tue, Dec 22, 2009 at 11:47 AM, maxim maxim <look2004il@xxxxxxxxx> wrote:
> > I have  a following  question, I try to receive a cursor position in
> > GtkEntry by function gtk_editable_get_position (GTK_EDITABLE (entry)),
> > but the  function returns a correct position only at expose-event, in
> > all other cases it returns a zero,  how to solve this problem?
> 
> You can try to access directly the property "cursor-position":
> 
> gint position = -1;
> g_object_get(G_OBJECT(entry), "cursor-position", &position, NULL);

If it made a difference it would be a bug in Gtk+.

By the way, working with properties is by no reasonable metric more
direct.  It does some complicated GValue trickery and at the end it
calls the same getter or setter.

Yeti

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux