Re: Pixmap Themes too slow (was gnomepad+)




On 14-Dec-99 James Henstridge wrote:
> If it is just the GtkText widget which is causing problems, you could
> probably modify the theme to not use pixmaps to draw GtkText widgets.
> 
> Just add something like the following to the theme:
>   class "GtkText" style "text"
>   style "text"
>   {
>     fg[NORMAL] = { 0.rr, 0.gg, 0.bb }
>     fg[PRELIGHT] = { ... }
>     fg[ACTIVE] = ...
>     fg[SELECTED] = ...
>     fg[INSENSITIVE] = ...
>     bg[...] = ...
>   }

        It does not appear to be the GtkText widget. I tried using this
example in the BlueMetal theme's gtkrc file (adding some color specifi-
cations and background colors, of course). When I ran gnotepad, it 
objected, saying that it didn't understand the "text" keyword, but also
starting up with a toolbar that did not have the BlueMetal pixmap in it,
and it worked fine. After realizing that I couldn't assign a style to a
 widget class until _after_ I'd defined the style, I ran gnotepad again,
and it was slow once again. After looking at the gnotepad source a 
little bit, I tried substituting "GtkToolbar" for "GtkText". Sure 
enough, gnotepad was faster (though not quite as fast as it was with
the screwed up version of gtkrc), but the pixmap was still visible in
the toolbar.

        This leads to my questions:

        1) Why should this be? It appears that the toolbar widget is
what Motif would call a container or manager widget, not visible, but
it contains other widgets. Why should a style affect its performance?

        2) Should GTK theme writers keep this behavior in mind, and
set all "manager" or "container" type widgets to have a color-only
style?

        BTW, here's my test procedure:

        1. Start gnotepad

        2. Resize the gnotepad window.

        3. Open a 20KB or so file that has very long lines (IOW,
        the newlines only occur after several 80-column lines).

        4. Scroll to the end of the file.

        5. Type something.

        Usually 4 and 5 are slow using a pixmap-based theme.
With color-only themes, performance of gnotepad is fine even over
a network connection to another X-server.

        The new gedit (0.6.1) does not have this problem. I'm not
picking on gnotepad here, it's just proven to be a handy example
of this problem.


----------------------------------
Date: 14-Dec-99  Time: 11:12:31

Craig Orsinger                  (email: <orsingerc@epg-gw1.lewis.army.mil>)
Logicon RDA
Bldg. 8B28                      "Just another megalomaniac with ideas above his
6th & F Streets                 station. The Universe is full of them."
Ft. Lewis, WA   98433                   - The Doctor
----------------------------------



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