Re: Making it easier to change a font.

On Fri, 4 Feb 2005 13:32:09 -0700, <pks timing com> wrote:

Marco Scholten writes:
> We could do cool stuff like packing some labels and entry's in a table and > then call Gtk::Table::modify_font() to change all the labels and entry's
 > at once.

I don't think it's that great for "non bin" containers such as table
(especially if modify_*() is used internally) or great care should be
taken not override settings the user made.

Imagine a two column table with the left column using one font and
the right column using another (because programmer took care to make
it so) and something coming along calling modify_font() on what holds
the table which propagates the modification to the table, which in turn
changes the appearance of the labels ...

I don't think that something like that would come along unless you explicitly call modify_font on the table or one of its parent containers, or can you name another situation where this would happen? Remember that you would still be able to make columns use different fonts like you always did, this would simply add functionality whithout adding API.

You have the same issue with Gtk::Bin like containers, but your suggestion
makes more sense (to me) for those.  I don't really think of tables,
boxes, layouts and stuff as widget's that "have (or should have)" fonts.

 > Perhaps this can be done for more functions then just modify_font.

if the function had a separate signature such as modify_all_*(), like
show() vs show_all(), none of it would be problem ... somebody calling
the "all" version of function should be aware of repercussions, or would
soon be :)

That would then require you to call m_Button.modify_all_font() wich would still require you to know that a button is in fact a container holding a label. From a users point of view, why should changing a font on a button be different from changing a font on a label?

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