Re: Getting/Setting text attributes for a GtkEntry
- From: Brian Cameron <Brian Cameron Sun COM>
- To: bill haneman Sun COM, peter korn Sun COM, marc mulcahy Sun COM
- Cc: Oisin Boydell Sun COM, gnome-accessibility-list gnome org
- Subject: Re: Getting/Setting text attributes for a GtkEntry
- Date: Thu, 7 Jun 2001 14:59:05 +0100 (BST)
Marc & Others:
> To play devil's advocate (no horns yet I hope), when you ask text for its
> attributes in most screen readers, or in Emacspeak, you get something
> back. It is never the case that you ask text for its attributes and get
> nothing since all text does have some basic attributes (size, color,
> etc). Does Pango not provide this info for us in the case of GtkEntry?
I'm raising this issue from the dead since now we're making headway
implementing the get/set of properties for text/editabletext.
Here is the status of the three widgets in question
+ GtkTextView allows get/set access to the attributes in the text.
GtkTextView stores defaults a little differently than the other text
widgets by storing them in view->layout->default_style. Currently
GtkTextView does not provide a function for getting the default
values, but the maintainers have agreed to add an access function,
so it should be available shortly.
+ GtkEntry does not allow users to set attributes in the text. It
does have default attributes are available in widget->style
which is accessable via gtk_widget_get_style().
+ GtkLabel does support attributes in the text and has a setter function.
I am currently working with the maintainers to determine how to get
the PangoAttributes from the label. I'm assuming the default values
are stored in widget->style but am awaiting confirmation from the
maintainers.
Aside from a few remaining questions about GtkLabel, things are pretty
much sorted about how things work currently.
Our current plan is that the ref_run_attributes() function will return
*just* the attributes that are in the text and not the default ones. We
can change this, but we would like a compelling use-case that explains
why this is needed.
It is a lot of extra work to support getting of default attributes so
we would like to avoid it unless there is a clear reason why it is needed.
If it is needed, then we can do this by one of the following ways:
1. Add a new function to get the default values.
2. Add an enumeration to the get function which allows the user to specify
if they want just the default values or just the values set within the
text.
3. Add an enumeration to the get function which allows the user to specify
if they want just the default values, just the values set within the
text, or a merge of the two.
Obviously 2 or 3 involve more work.
Thoughts?
Brian
> At 05:34 PM 5/30/2001 +0100, Bill Haneman wrote:
> >Peter Korn wrote:
> > >
> > > Hi Oisin Boydell,
> > >
> > > > The GtkEntry object does not support text attributes so the
> > > > atk_text_ref_run_attributes() function will return NULL (which
> > indicates no
> > > > attributes set) when called on a GtkEntry.
> > > > A GtkEntry is editable but since it does not support text attributes
> > a call to
> > > > atk_editable_text_set_run_attributes() will return failure.
> > >
> > > It is still interesting to know what the attributes are for the entire
> > GtkEntry
> > > widget. They will be set at the system level, but there are settings
> > there to
> > > discover. Why not return some special constants to indicate that the
> > run is the
> > > entire widget?
> >
> >It is trivial to return a textrun that encompasses the whole widget.
> >However it is not straightforward to return "attributes" over that
> >run, since technically there are none!
> >
> >I am not sure there is useful information to be gleaned here, and
> >would prefer not polluting the attribute sets with lots of "default"
> >stuff. Attributes are most interesting when they are
> >additions/modifications to the default case.
> >
> >-Bill
> >
> >
> > > Peter Korn
> > > Sun Accessibility team
> > >
> > > _______________________________________________
> > > gnome-accessibility-list mailing list
> > > gnome-accessibility-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
> >
> >--
> >--------------
> >Bill Haneman
> >Gnome Accessibility / Batik SVG Toolkit
> >Sun Microsystems Ireland
> >
> >_______________________________________________
> >gnome-accessibility-list mailing list
> >gnome-accessibility-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
>
>
> _______________________________________________
> gnome-accessibility-list mailing list
> gnome-accessibility-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]