Re: [Foxgui-users]RFC - Inconsistent Interfaces.

On Thu, 25 May 2000, you wrote:
> Some of you may be aware that I'm writing a Dialog Editor
> (version 0.1.2 is available on the FOX FTP site). I'm currently
> developing 0.2 and I've come across an issue which I'd like to
> discuss, if that's OK.
>
> Essentially the problem is that the FOX interface is inconsistent.
>
> The problem started with FXShutterItem. I wanted to add a Tip
> Text property, i.e:
>
> FXShutterItem* p = new FXShutterItem(...
>
> p->setTipText("Hello");
>
> Well, that doesn't work. Instead you have to:
>
> p->getButton()->setTipText();
>
> My approach to this was to add a new setTipText member to
> FXShutterItem so that the interface is consistent, that is:
>
> FXButton* b = new FXButton(...
> FXShutterItem* s = new FXShutterItem(...
> FXWhatever* w = new FXWhatever(...
>
> b->setTipText("Hello");
> s->setTipText("Hello");
> w->setTipText("Hello");
>
> I posted a note about this a few weeks ago and Jeroen
> pointed out that:
>
> "Really, FXShutterItem and FXShutter are mega-widgets. Think
> of these classes as building not just one node on a widget
> tree, but a small subbranch. While its certainly possible to
> do what you want, you will get a huge API explosion carrying
> this idea forward to some more complicated mega-widgets, like
> FXFileSelector,and so on."
>
> My reply was (and still is):
>
> "Hmmm. OK. My only concern, though, is that the interface
> is not consistent. This is apparent to me as I'll now have
> to create variants of the Text, TipText and HelpText
> properties just for shutter items. I'd like to be able
> to call setTipText without having to think about which
> class I'm using. It's these idiosyncrasies that consume
> developer time. Am I being unreasonable?"
I think you're right, we want to pretend some of these Mega-Widgets
behave like the basic building blocks.
> I'm starting to find more and more issues like this as I go.
>
> For example, FXComboBox (which is a composite) DOES provide
> a setTipText. FXComboBox::setBackColor, OTOH, does not override
> FXWindow::setBackColor. This means that if you call this
> function it changes the color in between the text field and
> the FXButton and not the text field and the drop down list
> as I think it should. Not only that but the FXComboBox
> does not expose getTextWidget(), getListWidget() etc.
>
> Now that I've got the plumbing done for DlgEdit-0.2 I'm very
> likely to encounter all sorts of inconsistencies like this.
>
> So, before I do, how do we want to handle them? If at all?
>
> I know you guys are all off doing deep, heavy stuff like
> journaling and graphics but I'm sort of stuck :-)
>
> Martin
I think some mega widgets can probably considered to be a "Widget" while
perhaps others are clearly composite beasts (like e.g. FXFontSelector).
So you've made your case, I'll add these API's.
- Jeroen
P.S.
Your builder is really cool, and I'd love to refer to a web page, or at least
have a couple of good screen shots. If you can supply both, that would be
even better, so I can add URL's to the main web pages.
--
+----------------------------------------------------------------------------+
| E-Mail : jvz@... `:::' ....... ...... |
| USMail : 215 Wynn Drive, ::: * `::. ::' |
| Huntsville, AL 35805 ::: .:: .:.::. .:: .:: `::. :' |
| Phone : (256) 726-4820 ::: :: :: :: :: :: :::. |
| Fax : (256) 726-4806 ::: .::. .:: ::. `::::. .:' ::. |
| WWW : http://www.cfdrc.com .:::.....................::' .::::.. |
+----------------------------------------------------------------------------+
| Check out the FOX GUI toolkit: |
| U.S.A. [Official]: http://www.cfdrc.com/FOX/fox.html |
| ftp://ftp.cfdrc.com/pub/FOX |
| Europe [Mirrors]: ftp://SunSITE.Informatik.RWTH-Aachen.DE/pub/Linux/fox/ |
| ftp://imssun1.epfl.ch/pub |
+----------------------------------------------------------------------------+

Thread view

Some of you may be aware that I'm writing a Dialog Editor
(version 0.1.2 is available on the FOX FTP site). I'm currently
developing 0.2 and I've come across an issue which I'd like to
discuss, if that's OK.
Essentially the problem is that the FOX interface is inconsistent.
The problem started with FXShutterItem. I wanted to add a Tip
Text property, i.e:
FXShutterItem* p = new FXShutterItem(...
p->setTipText("Hello");
Well, that doesn't work. Instead you have to:
p->getButton()->setTipText();
My approach to this was to add a new setTipText member to
FXShutterItem so that the interface is consistent, that is:
FXButton* b = new FXButton(...
FXShutterItem* s = new FXShutterItem(...
FXWhatever* w = new FXWhatever(...
b->setTipText("Hello");
s->setTipText("Hello");
w->setTipText("Hello");
I posted a note about this a few weeks ago and Jeroen
pointed out that:
"Really, FXShutterItem and FXShutter are mega-widgets. Think
of these classes as building not just one node on a widget
tree, but a small subbranch. While its certainly possible to
do what you want, you will get a huge API explosion carrying
this idea forward to some more complicated mega-widgets, like
FXFileSelector,and so on."
My reply was (and still is):
"Hmmm. OK. My only concern, though, is that the interface
is not consistent. This is apparent to me as I'll now have
to create variants of the Text, TipText and HelpText
properties just for shutter items. I'd like to be able
to call setTipText without having to think about which
class I'm using. It's these idiosyncrasies that consume
developer time. Am I being unreasonable?"
I'm starting to find more and more issues like this as I go.
For example, FXComboBox (which is a composite) DOES provide
a setTipText. FXComboBox::setBackColor, OTOH, does not override
FXWindow::setBackColor. This means that if you call this
function it changes the color in between the text field and
the FXButton and not the text field and the drop down list
as I think it should. Not only that but the FXComboBox
does not expose getTextWidget(), getListWidget() etc.
Now that I've got the plumbing done for DlgEdit-0.2 I'm very
likely to encounter all sorts of inconsistencies like this.
So, before I do, how do we want to handle them? If at all?
I know you guys are all off doing deep, heavy stuff like
journaling and graphics but I'm sort of stuck :-)
Martin

On Thu, 25 May 2000, you wrote:
> Some of you may be aware that I'm writing a Dialog Editor
> (version 0.1.2 is available on the FOX FTP site). I'm currently
> developing 0.2 and I've come across an issue which I'd like to
> discuss, if that's OK.
>
> Essentially the problem is that the FOX interface is inconsistent.
>
> The problem started with FXShutterItem. I wanted to add a Tip
> Text property, i.e:
>
> FXShutterItem* p = new FXShutterItem(...
>
> p->setTipText("Hello");
>
> Well, that doesn't work. Instead you have to:
>
> p->getButton()->setTipText();
>
> My approach to this was to add a new setTipText member to
> FXShutterItem so that the interface is consistent, that is:
>
> FXButton* b = new FXButton(...
> FXShutterItem* s = new FXShutterItem(...
> FXWhatever* w = new FXWhatever(...
>
> b->setTipText("Hello");
> s->setTipText("Hello");
> w->setTipText("Hello");
>
> I posted a note about this a few weeks ago and Jeroen
> pointed out that:
>
> "Really, FXShutterItem and FXShutter are mega-widgets. Think
> of these classes as building not just one node on a widget
> tree, but a small subbranch. While its certainly possible to
> do what you want, you will get a huge API explosion carrying
> this idea forward to some more complicated mega-widgets, like
> FXFileSelector,and so on."
>
> My reply was (and still is):
>
> "Hmmm. OK. My only concern, though, is that the interface
> is not consistent. This is apparent to me as I'll now have
> to create variants of the Text, TipText and HelpText
> properties just for shutter items. I'd like to be able
> to call setTipText without having to think about which
> class I'm using. It's these idiosyncrasies that consume
> developer time. Am I being unreasonable?"
I think you're right, we want to pretend some of these Mega-Widgets
behave like the basic building blocks.
> I'm starting to find more and more issues like this as I go.
>
> For example, FXComboBox (which is a composite) DOES provide
> a setTipText. FXComboBox::setBackColor, OTOH, does not override
> FXWindow::setBackColor. This means that if you call this
> function it changes the color in between the text field and
> the FXButton and not the text field and the drop down list
> as I think it should. Not only that but the FXComboBox
> does not expose getTextWidget(), getListWidget() etc.
>
> Now that I've got the plumbing done for DlgEdit-0.2 I'm very
> likely to encounter all sorts of inconsistencies like this.
>
> So, before I do, how do we want to handle them? If at all?
>
> I know you guys are all off doing deep, heavy stuff like
> journaling and graphics but I'm sort of stuck :-)
>
> Martin
I think some mega widgets can probably considered to be a "Widget" while
perhaps others are clearly composite beasts (like e.g. FXFontSelector).
So you've made your case, I'll add these API's.
- Jeroen
P.S.
Your builder is really cool, and I'd love to refer to a web page, or at least
have a couple of good screen shots. If you can supply both, that would be
even better, so I can add URL's to the main web pages.
--
+----------------------------------------------------------------------------+
| E-Mail : jvz@... `:::' ....... ...... |
| USMail : 215 Wynn Drive, ::: * `::. ::' |
| Huntsville, AL 35805 ::: .:: .:.::. .:: .:: `::. :' |
| Phone : (256) 726-4820 ::: :: :: :: :: :: :::. |
| Fax : (256) 726-4806 ::: .::. .:: ::. `::::. .:' ::. |
| WWW : http://www.cfdrc.com .:::.....................::' .::::.. |
+----------------------------------------------------------------------------+
| Check out the FOX GUI toolkit: |
| U.S.A. [Official]: http://www.cfdrc.com/FOX/fox.html |
| ftp://ftp.cfdrc.com/pub/FOX |
| Europe [Mirrors]: ftp://SunSITE.Informatik.RWTH-Aachen.DE/pub/Linux/fox/ |
| ftp://imssun1.epfl.ch/pub |
+----------------------------------------------------------------------------+

>
> So you've made your case, I'll add these API's.
>
Great. Do you want me to post any other inconsistencies as I find them or
wait 'till later? For example:
FXList, FXDirList, FXFileList do not have padleft, padright,padbottom,
padtop.
FXSpinner doesn't support BackColor
> P.S.
>
> Your builder is really cool, and I'd love to refer to a web page, or at
least
> have a couple of good screen shots. If you can supply both, that would be
> even better, so I can add URL's to the main web pages.
>
I'm working on a tiny web site but it, like any screen shots, are geared
toward version 0.2 so I kind of planned on releasing them all together. I
could put some screenshots together so that you can see progress so far. Is
that any use?
Cheers!
Martin