Re: Interface to gtktext...or perhaps gtkeditable




Thomas Mailund Jensen <mailund@daimi.aau.dk> writes:

> Inside gtktext.c there's a lot of nice functions for moving around:
> 
> static void gtk_text_move_forward_character    (GtkText          *text);
> static void gtk_text_move_backward_character   (GtkText          *text);
> static void gtk_text_move_forward_word         (GtkText          *text);
> static void gtk_text_move_backward_word        (GtkText          *text);
> static void gtk_text_move_beginning_of_line    (GtkText          *text);
> static void gtk_text_move_end_of_line          (GtkText          *text);
> static void gtk_text_move_next_line            (GtkText          *text);
> static void gtk_text_move_previous_line        (GtkText          *text);
> 
> These are really virtual functions from gtkeditable:
> 
>   void (* move_cursor)     (GtkEditable *editable,
> 			    gint         x,
> 			    gint         y);
>   void (* move_word)       (GtkEditable *editable,
> 			    gint         n);
>   void (* move_page)       (GtkEditable *editable,
> 			    gint         x,
> 			    gint         y);
>   void (* move_to_row)     (GtkEditable *editable,
> 			    gint         row);
>   void (* move_to_column)  (GtkEditable *editable,
> 			    gint         row);
> 
> Something simular goes for kill_* functions.

This signals are here as hooks for the new key binding system.

One reason that they aren't exported yet is that they may
well change. (They are very inconsistent with the actions
used in the CList right now - and I think that needs to be
fixed on one or both sides)

> Now, I would like to bind these to GUILE (macros using such functions
> are *vastly* more useful than macros how doesn't).  but I cannot get
> to them...cause there's no gtk_editable_* or (gtk_text_*) counterpart.
> 
> I know, I know, I can get to the functions if I get the class
> struct...but this seems a little more trouble than absolutely needed.
> 
> I really need the gtk_editable_* functions!  Is there any reason *not*
> to add them?

They aren't just virtual functions, they are signals so (in C)

 gtk_signal_emit_by_name (GTK_OBJECT (editable), "move_page", -1, 0);

will work fine. But I agree that it might be nice to have a functional
interface to these signals as well. (We typically do for any
signals that are useful to an application)

However, as mentioned above, these signals are not yet finalized...

Regards,
                                        Owen



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