States in GailLabel



GtkLabel's support single-line and multi-line labels.  There is no
direct gtk_label_function to tell if a label is single-line or
multi-line, but you can tell with a little bit of digging through
the GtkLabel's pango structures.

Here is the definitions of ATK_STATE_MULTI_LINE and
ATK_STATE_SINGLE_LINE:

  ATK_STATE_MULTI_LINE:
    Indicates this (text) object can contain multiple lines of text
  ATK_STATE_SINGLE_LINE:
    Indicates this (text) object can contain only a single line of text

Since labels are read-only, they do not typically change.  They can
change programmatically, and they could change between a single-line
label and a multi-line label, though this is probably not very common.

Currently GailLabel just blindly says it is ATK_STATE_MULTI_LINE since
GtkLabel "can contain multiple lines of text".

However, should it be more dynamic and actually check to see if it
is single-line or multi-line, and set its value appropriately.
If this is so, then it will need to possibly update its state value
each time it generates a "text-changed" signal.

Is there a use-case where knowing if a label has state SINGLE_LINE
or MULTI_LINE is actually useful?

Brian





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