Antonio Coralles wrote:
Ok, after experimenting a bit I achieved what I wanted to do by overriding insert_text_vfunc. text is the text which would be inserted and position the position where inserting starts - which can be modified through &. If I want the insertion to take place I call the base class insert_text_vfunc. Eventually I can pass a modified string to that method ...I just was thinking about the most elegant way of restricting the chars a user can enter into a Gtk::Entry. At first i thought I should do that by overriding on_changed() but then, after looking at the dokumentation for Gtk::Editable the functions
virtual void insert_text_vfunc (const Glib::ustring& text, int& position) virtual void on_insert_text (const Glib::ustring& text, int* position)
caught my attention. The problem is that these functions are completeley undocumented - especially I don't understand what i should do with int& / int* position - what happens when i change the value of position/*position ? Are these functions at least suitable for my purpose ? Should i call [when overriding] the base class routines if i want a char to be accepted and avoid that if i don't want that ?
So the question that remains is what on_insert_text is for and why does it use int* instead of int& ?
Antonio
_______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
