This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug AWT/16738] New: Can't set fonts for List


If you run Acunia's Font.SetFont test, you'll notice that you can't
set the font for Label, Checkbox and List.  If you press the different
Font buttons, these said components will not change.

I think the fix is just a matter of implementing setFont() and the
corresponding native methods in their peers.  I'm not going to touch
List just yet because the peer code will change soon.
------- Additional Comments From fitzsim at redhat dot com  2004-02-26 12:29 -------
Yeah, there's a FIXME about this in GtkComponentPeer.setFont.  If it's
not enough to implement that method with gtk_widget_set_font or some
other widget-general function, then we'll have to handle fonts as we
handle colors; a general awt_set_font that you hand a widget and that
figures out its type and sets the font accordingly.

------- Additional Comments From djee at redhat dot com  2004-02-26 15:15 -------
We can (and already do) use gtk_widget_modify_font(), but it won't
work generally since some of our components are complex widgets (eg
Label = GtkLabel packed into a GtkEventBox).  These cases need to
handled separately (i.e. find the widget that actually contains the
text and modify it.)

What I'm confused about is why we can't keep our current setup (i.e.
each component peer implements its own setFont() and a corresponding
native method, so that special components like Label can deal with its
own special problems.)

Also, could you explain to me the exact meaning of that FIXME in
GtkComponentPeer.setFont()?  Is it saying that a call to setFont() on
a component should propagate to its children as well?  If so, then I'm
not sure if it's correct because I haven't read anything about that in
any of the documentations.  I think I'm misinterpreting it though.
------- Additional Comments From fitzsim at redhat dot com  2004-02-26 15:24 -------
Yeah, maybe it would be better to just override setFont.

I didn't write it, but I think the FIXME means what you said: if you
call setFont on a container, the changes should propagate to its
children.  The behaviour may not be documented explicitly; I'd say try
it out with Sun.

------- Additional Comments From djee at redhat dot com  2004-02-27 14:51 -------
Most of this is now fixed in java-gui-branch, with the exception of
Lists.  I'm modifying the bug summary accordningly.

I checked Sun's font inheritance behaviour, and it seems that if a
container's child doesn't have a font set yet, it inherits from the
parent.  That's how I've implemented it in my recent patch as well.
------- Additional Comments From fitzsim at redhat dot com  2004-05-18 18:15 -------
OK, I've implemented GtkListPeer's gtkSetFont method, and checked it
in on java-gui-branch, so now Lists work too.  Verified fixed.


-- 
           Summary: Can't set fonts for List
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: AWT
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: djee at redhat dot com
                CC: djee at redhat dot com,gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16738


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]