Ethereal-dev: Re: [ethereal-dev] Font choice changes

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Mon, 21 Aug 2000 01:22:20 -0700
On Sun, Aug 20, 2000 at 01:12:59AM -0700, Guy Harris wrote:
> Currently, selecting the font won't change the fonts used in the current
> session; you'd have to exit Ethereal and restart it to get the new
> fonts.  I'll have to see how to redraw the various widgets with a new
> font in order to make that work.

Well, I have it working for the packet list and protocol tree widgets.

I ended up changing the Preferences dialog code and behavior.  There's
now an "Apply" button on the Preferences dialog, which applies the
preferences without dismissing the dialog box.  In the GUI preference
tab, changing the settings doesn't cause the new setting to take effect
immediately - the setting doesn't take effect until "OK", "Save", or
"Apply" is clicked.  ("Save" has always had an implied "Apply".)

In addition, closing the Preferences dialog box from the window manager
is equivalent to pressing "Cancel" - it reverts all preference settings
to the values they had when the dialog box was popped up.

Making font changes apply to the hex dump window is more work - for the
packet list and protocol tree window, all I had to do was change the
style of the widget to a new style with the new font (I also changed the
protocol tree code so that the tree widget as a whole has the style,
rather than setting the style for each entry), but for the hex dump
window, the window would have to be redrawn - I'd have to make sure
that, regardless of whether any field is selected or not, information
sufficient to figure what, if anything, is to be boldfaced is available.

Either the font selection dialog box in GTK+ 1.2.8 is a little broken,
or I'm not setting the font correctly - it *should*, when popped up,
have the current font in the preferences selected as the current font,
but it appears to pick some random font, or no font, on occasion.