[Mono-winforms-list] Theming in MWF
Peter Dennis Bartok
peter at novonyx.com
Fri Jul 29 14:30:17 EDT 2005
Every few months the same discussion comes up again.
I'll try to answer various questions/points/nitpicks/etc brought up in this
thread all in one message:
1) Native widgets on all operating systems
It is not feasible to use native widgets on all operating systems. Each
OS/Windowing system has different behaviour/properties/features for what on
the surface looks like the same widget. A RadioButton in Gnome is different
from a RadioButton in Win32 is different from a RadioButton in OS X. To use
the native widgets means to reduce the functionality of MWF to the least
common denominator of all operating systems supported. If we were designing
our own that might even be acceptable, but we are implementing a defined API
with defined behaviour (and even with applicatio relied-upon side-effects).
The behaviour of a RadioButton has to be exactly like it behaves on Win32
with MS .Net. Anything else and applications written for may not work
properly anymore. And that's the whole point of SWF, to allow running
existing .Net SWF apps with Mono. For all other uses there is Gtk#
2) Why is there a themeing interface?
Because at some point we want to be able to achive a more native look'n'feel
for SWF apps, depending on what Platform/Window manager they run on. And
having a separate theme class from the get-go forces those who are writing
the controls to design code where the drawing code is not integrated and
intermingled with the control code.
3) We should not have/redesign the theme interface
Not having one is not an option. Redesign? Yes. We knew from the get-go that
the themeing interface wasn't gonna work the way it is. But, until all
controls are written and we can look at what the drawing requirements for
each control are, there was no point in designing a themeing interface
(short of an academic excercise, where the API is discussed for 1 1/2 in
comittee hell, and we were planning on having a finished lib this decade)
So, we came up with something very simple, played a bit with a
proof-of-concept Gtk theme to see that what we had was somewhat realistic,
and went on to write the controls. Yes some people got a bit sloppy and put
control logic into the drawing code, but so what? That will be taken care of
once we start work on the themes. It's much easier to move a bit of business
logic out of the drawing and back into the control than the other way
'round.
4) Themeing adds an aditional performance-impacting layer
I won't buy that argument until someone can show me that the one extra call
adds so much overhead that it's worth not having themes. And, when comparing
apples to apples and using our MWF on Win32 with MS' System.Drawing, our
performance is mostly en-par with MS (And their SWF controls are only
wrappers around Win32 controls)
5) Win32Classic only/Colors/etc
The goal of our implementation is to be not only function/property/behaviour
compatible, but also pixel compatible. Many apps rely on the exact look of
controls to do their thing. We need to be able to also have that look, to
make users feel the app is usable. The theme that is supposed to provide
pixel compatibility is Win32Classic, which is why any work is today done in
there.
Color integration to the desktop/window manager is somewhat independent from
actual themes (A theme may also alter the actual drawing of a control), and
it is very high on our list. Miguel emphasizes the issue every time I talk
to him. But there's only so many hours in the day, and our stated goal was
and is to complete our controls first, before we get into those things. I
understand that being able to have a pink button is the most important thing
to many users, but that's because for them, the fact that the button
actually works is a given and they don't even think about that. We, however,
are still in the stage were we need to make that button work before we can
worry about whether or not it is pink. (And yes, I know, button does work,
I'm using button as an example for any control)
Cheers,
Peter
-----Original Message-----
From: "Kornél Pál" <kornelpal at hotmail.com>
To: "Jonathan S. Chambers" <Jonathan.Chambers at ansys.com>; "Jordi Mas"
<jordi at ximian.com>
Cc: <mono-winforms-list at ximian.com>
Date: 29 July, 2005 07:37
Subject: Re: [Mono-winforms-list] Theming in MWF
>Yes I am suggesting using native widgets on all operating systems.
>
>Note that controls have a FlatStyle property and native widget
>representation (I mean the appeareance regardless of using native or
>managed
>widgets internally) should be used when it is FlatStyle.System otherwise
>System.Drawing should be used.
>
>Kornél
>
>----- Original Message -----
>From: "Jonathan S. Chambers" <Jonathan.Chambers at ansys.com>
>To: "Jordi Mas" <jordi at ximian.com>; "Kornél Pál" <kornelpal at hotmail.com>
>Cc: <mono-winforms-list at ximian.com>
>Sent: Friday, July 29, 2005 3:28 PM
>Subject: RE: [Mono-winforms-list] Theming in MWF
>
>
>Are you suggesting something more akin to the SWT implementation on Java?
>Where native widgets are used when possible, and when not a managed
>implementation is done?
>
>-----Original Message-----
>From: mono-winforms-list-bounces at lists.ximian.com
>[mailto:mono-winforms-list-bounces at lists.ximian.com] On Behalf Of Jordi Mas
>Sent: Friday, July 29, 2005 8:37 AM
>To: Kornél Pál
>Cc: mono-winforms-list at ximian.com
>Subject: Re: [Mono-winforms-list] Theming in MWF
>
>El dv 29 de 07 del 2005 a les 14:38 +0200, en/na Kornél Pál va escriure:
>
>Hi Kornél,
>
>> As I know MWF uses a single theme and it draws everything using
>> System.Drawing and does not use any native control representations.
>> On Windows it is possible to let the system draw controls. If it possible
>> under X11 and OS X as well?
>
>Well, that you are asking is that Microsoft have done for SWF, a light
>wrapper on the Win32 API (including controls).
>
>To archive what you want you will need a new SWF implementation, cannot
>be done with the current model or at least easily.
>
>> On Windows there are system colors that could be used to color controls.
>> Is
>> the something equivalent on X11 and OS X?
>
>System Colors and MWF are in our TODO list... we have not started on
>that yet.
>
>Jordi,
>
>--
>Jordi Mas i Hernàndez - Mono development team - http://www.mono-project.com
>Homepage and LiveJournal at http://www.softcatala.org/~jmas
>
>
>_______________________________________________
>Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
>
>_______________________________________________
>Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
>_______________________________________________
>Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
>
More information about the Mono-winforms-list
mailing list