Re: textview virtual function is, or isn't?



Steven Ashe <steve ashe minolta-qms com> writes:
> 
> When is a function in a class' virtual table truly virtual?
>

There are three common kinds of function pointers in GTK:

 - virtual functions (weirdly, these are sometimes registered as
   signals, but the "signal" aspect of them is often useless; for
   example the "show" signal in GtkWidget is almost never interesting
   to connect to. however, sometimes they are useful to connect to,
   such as the insert_text signal on TextBuffer or Editable). These
   are distinguishable from signals because they have an action name
   like insert_text (vs. text_inserted).

 - notification signals; e.g.  "clicked" or a hypothetical
   "text_inserted"; here the signal is the main thing, and normally 
   the function in the class struct doesn't even do anything.

 - keybinding signals; these are registered as signals so that 
   GTK can introspect the function signature. Nearly all the 
   TextView signals including delete_from_cursor are in this 
   category. There's no guarantee that an operation such 
   as deletion goes through delete_from_cursor, delete_from_cursor
   is only emitted when a keybinding attached to it is used.
   (The relevant GTK feature to learn about this is GtkBindingSet.)

You're the second person to ask about "clumping" characters in the
text widget, we aren't going to be able to implement this for 2.0, 
but there's an open bug if you want to add yourself to the CC field
for it:
 http://bugzilla.gnome.org/show_bug.cgi?id=60364

In general the text widget needs some framework for overriding all the
default behavior of mouse and keyboard. I don't know how to provide
this in a sane way, however. Instead we may end up adding builtin
support for things people commonly want to do, once we have a good
enough sample of what those things are.

delete_from_cursor really won't get you anywhere, for this clumping
feature to work 100% what you need to do is override the "grapheme
boundaries" (cursor positions) used by the text widget, i.e. create
your own clusters/graphemes; this probably involves modifications down
to the Pango level... the text widget does already support "clumping,"
but it only clumps characters that form clumps in natural language.

Havoc




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