From: Michael Fasolino <Michael_Fasolino raytheon com>
To: "Jonathon Jongsma" <jonathon jongsma gmail com>
Cc: gtkmm-list gnome org
Subject: Re: Text Entry Box - text alignment
Date: Wed, 21 Feb 2007 11:21:19 -0600
I actually tried to run down that path,
but encountered the following problem. My text entry box is of class
Gtk::Entry. The compiler that I am using (MSVS 2005) gives me an
error when I try to use the get_editable_set_position() fn since it can't
"convert parameter 1 from Gtk::Entry
*' to 'GtkEditable *'".
I can't find a member function similar
to get_editable_set_position() that belongs to the Gtk::Entry class. Like
you said, it is not documented anyway. Is there a way to type cast
the GtK::Entry into a GtkEditable type? Or is there a way to find
a similar function that will operate on a Gtk::Entry type?
Sorry for my confusion, I am pretty
new to GTK and Gtkmm. Thanks for your help!
On 2/21/07, Michael Fasolino <Michael_Fasolino raytheon com>
wrote:
>
> I am currently porting an existing tool to be platform independent,
so in order to keep the same look and feel, I would like to use a Text
Entry box. If it ends up that I can't do what needs to be done with
the text box, than I will switch over to the FileChooserButton. Also,
after searching for a while to find a way to align the text (when it is
longer than the text entry can display) and not being able to find anything
in gtkmm, I am kind of curious to hear if there is solution I am missing:)
>
> Thank you,
>
> Michael
I've never tried to do this, so this is just a guess. Could you do
what you want simply by setting the cursor position to the end of the
text entry box? I think there's a set_position() function and passing
a value of -1 means to place the cursor at the end (It appears that
this function isn't documented in gtkmm, but that's what the GTK+ docs
say [1]). I believe the default behavior of a GtkEntry is to 'scroll'
to show the cursor position, so this might do what you want. But
I
can't really test out my theory right now.