Re: Text Entry Box - text alignment



On 2/21/07, Michael Fasolino <Michael_Fasolino raytheon com> wrote:

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!


I'm not sure what this get_editable_set_position function is.  But
Gtk::Entry derives from Gtk::Editable, so it should have a
set_position() function.  So you should be able to just use
Gtk::Entry::set_position().

Ahh, now that I look at it, did you mean gtk_editable_set_position()?
There's not really any reason that you need to use the base GTK+ C
functions unless you want to.  If you do want to use the C functions
for some reason, you can always get a pointer to the C object from a
gtkmm object by calling for example Gtk::Entry::gobj() and then
casting this to GtkEditable*.  But I would just try to use the wrapped
gtkmm function as I described above.
--
jonner



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