Discussion:
[Jemacs-info] Beginning of a modeline for SwtJemacs'
Christian Surlykke
2005-05-21 16:54:23 UTC
Permalink
Hi

This patch contains a modeline for SwtJemacs.

It consists of:
A new class "gnu.jemacs.swt.widgets.SwtWindowWidget". Up til now I've gotten away with using just the widgets that come with Swt and JFace, but here it seemed more convenient to write a new composite widget containing an StyledText for displaying and editing buffers and an (one-line, read-only) StyledText for displaying the modeline.
I've created a package - gnu.jemacs.swt.widgets - for it. Once I get around to making an echo area/minibuffer for SwtFrame there will be at least one more widget to go in here.
SwtWindow now has a swtWindowWidget field instead of the styledText field it used to have.

A field - modeLine - on SwtBuffer which is an FString.
The plan is that the lisp function 'redraw-modeline' should pick up the buffer-local variable modeline-format, convert it to an FString and put it int
Per Bothner
2005-05-21 17:53:07 UTC
Permalink
Post by Christian Surlykke
This patch contains a modeline for SwtJemacs.
Thanks. Before I check this in:

The string "StyledText" get printed occasionally,
which is a little distracting. Should we fix this?

There are some focus problems. When I first start Jemacs,
the JEmacs window doesn't get focus. Even moving the mouse
over the window (I have mouse-follow-focus) doesn't work -
I have to click for the window to get focus.

Creating a few sub-window with crtl-x 4 ctrl-f works,
but now *neither* window has focus.

If these are unrelated problems, I can check in your patch
before we work on them.
--
--Per Bothner
***@bothner.com http://per.bothner.com/
Christian Surlykke
2005-05-21 18:41:14 UTC
Permalink
Here's a patch for the "StyledText" printout, to go ontop of the Modeline patch.

Wrt. focus, I think this is unrelated to the modeline patch. I did a clean checkout of kawa, and swtJemacs seems there also to have the problems you described.
I suggest you check in the modeline patch, and I'll look into the focus problems.

br. Chr.
Post by Per Bothner
Post by Christian Surlykke
This patch contains a modeline for SwtJemacs.
The string "StyledText" get printed occasionally,
which is a little distracting. Should we fix this?
There are some focus problems. When I first start Jemacs,
the JEmacs window doesn't get focus. Even moving the mouse
over the window (I have mouse-follow-focus) doesn't work -
I have to click for the window to get focus.
Creating a few sub-window with crtl-x 4 ctrl-f works,
but now *neither* window has focus.
If these are unrelated problems, I can check in your patch
before we work on them.
Per Bothner
2005-05-21 19:08:04 UTC
Permalink
Post by Christian Surlykke
A new class "gnu.jemacs.swt.widgets.SwtWindowWidget". Up til now I've gotten away with using just the widgets that come with Swt and JFace, but here it seemed more convenient to write a new composite widget containing an StyledText for displaying and editing buffers and an (one-line, read-only) StyledText for displaying the modeline.
I've created a package - gnu.jemacs.swt.widgets - for it. Once I get around to making an echo area/minibuffer for SwtFrame there will be at least one more widget to go in here.
SwtWindow now has a swtWindowWidget field instead of the styledText field it used to have.
I prefer not to create a new package. Especially, a new package with
just a single class. Even for two classes I think keeping them in the
main package is preferable. If nothing else for consistency, since
swing doesn't have a sub-package.

Also, gnu.jemacs.swt.widgets would be the first 4th-level package.
I've tried to avoid getting too deep.

It's just a minor preference of mine, and I certainly admit the Kawa
package hierarchy has some awkwardnesses.
--
--Per Bothner
***@bothner.com http://per.bothner.com/
Christian Surlykke
2005-05-21 19:47:00 UTC
Permalink
Post by Per Bothner
I prefer not to create a new package.
Ok. I'll send you a new patch tomorrow with SwtWindowWidget moved to gnu.jemacs.swt.
Maybe also a fix for the focus thing.

Chr.
Christian Surlykke
2005-05-22 18:14:44 UTC
Permalink
Here's a new version of the modeline patch.
It differs from what I sent yesterday by:

- Removing the annoying 'StyledText' output
- Putting the SwtWindowWidget class in gnu.jemacs.swt rather than gnu.jemacs.swt.widget
- Forcing focus to be in the StyledText widget when a new JEmacs window is created. This seems to fix the focus issues although I don't quite understand why.
- removing some debug statements in splitWindow.

Formalia:

I, Christian Surlykke, hereby assign the copyright to the code-changes attached to this mail, to Per Bothner on the condition that he will make them available under the Gnu General Public License, Version 2,  as published by the Free Software Foundation. Other than that no restrictions on Per Bothners use of the changes is implied.
I declare that I am the sole author of these changes and that I know of no other person having any claims on it.

br. Chr.
Per Bothner
2005-05-24 05:35:28 UTC
Permalink
Post by Christian Surlykke
Here's a new version of the modeline patch.
I checked this in. Thanks!
--
--Per Bothner
***@bothner.com http://per.bothner.com/
Loading...