Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-26 Thread Stanislav Maslovski
On Sun, Aug 26, 2007 at 05:04:26PM +0400, Stanislav Maslovski wrote:
> On Sun, Aug 26, 2007 at 10:47:42PM +1000, Neil Hodgson wrote:
> > Stanislav Maslovski:
> > 
> > > Here goes the 3rd version of the patch (attached).
> > >   - focus behaviour corrected (finally?)
> > >   - LayoutUI() is now called after the properties have been read
> > >   - set minimum size hint to wContent
> > >
> > > Please check.
> > 
> >With this patch starting SciTE and opening a file doesn't show the
> > file: instead the output pane is maximized.
> 
> Sounds interesting :) I do not get such a behaviour here. Do you open the
> file the usual way from File->Open?
> 
> What is your GTK version? I will try to reproduce this.

No need. I got it. That is because of this change:
  - LayoutUI() is now called after the properties have been read 

Some resizing events got lost this way, I thought it would be harmless,
however. Sorry..

I will correct this.

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-26 Thread Stanislav Maslovski
On Sun, Aug 26, 2007 at 10:47:42PM +1000, Neil Hodgson wrote:
> Stanislav Maslovski:
> 
> > Here goes the 3rd version of the patch (attached).
> >   - focus behaviour corrected (finally?)
> >   - LayoutUI() is now called after the properties have been read
> >   - set minimum size hint to wContent
> >
> > Please check.
> 
>With this patch starting SciTE and opening a file doesn't show the
> file: instead the output pane is maximized.

Sounds interesting :) I do not get such a behaviour here. Do you open the
file the usual way from File->Open?

What is your GTK version? I will try to reproduce this.

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] addition: remove a couple of unused vars

2007-08-23 Thread Stanislav Maslovski
I forgot to remove a couple of old variables that are not used anymore.
Correction attached.

-- 
Stanislav
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-08-23 23:24:19.759831904 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-23 23:20:18.0 +0400
@@ -308,8 +308,6 @@
 protected:
 
 	GtkWidget *splitPane;
-	Point ptOld;
-	GdkGC *xor_gc;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -566,8 +564,6 @@
 	ReadGlobalPropFile();
 	ReadAbbrevPropFile();
 
-	ptOld = Point(0, 0);
-	xor_gc = 0;
 	saveFormat = sfSource;
 	comboFiles = 0;
 	paramDialogCanceled = true;
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Stanislav Maslovski
On Thu, Aug 23, 2007 at 10:43:23PM +1000, Neil Hodgson wrote:
> # Try this:
> #
> # 1. convert properties files to utf-8 using iconv (or you can do it only
> # with your user properties file).
> 
>Don't do this to SciTEGlobal.properties as it will make
> chars.accented useless.

Oops, I did not know. If they are byte values, then what encoding is
assumed for them? Btw, I also use a UTF-8 locale.

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Stanislav Maslovski
Hello,

On Thu, Aug 23, 2007 at 09:37:48AM +0200, Jan Boehme wrote:
> Hi!
> 
> Maxime Carron wrote:
> > I'm a bit new to SciTE, but I don't suffer from any problem with it on
> > F-7.x86_64.
> > SciTE crashes with every files or only with SciTEGlobal.properties?
> 
> SciTE crashes with some files not only with SciTEGlobal.properties. I
> removed my personal properties file and now it works. At least it
> doesn't crash anymore.
> 
> I get pango warnings
> 
> (scite:4552): Pango-WARNING **: Invalid UTF-8 string passed to
> pango_layout_set_text()
> 
> when I open SciTEGlobal.properties and scroll down to:
> 
> # Define values for use in the imported properties files
> chars.alpha=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
> chars.numeric=0123456789
> chars.accented=ŠšŒœŸÿÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖØøÙùÚúÛûÜüÝýÞþßö
> # This is a better set for Russian:
> #chars.accented=ÀàÁáÂâÃãÄäÅ娸ÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ
> 
> I have to say that on the system SciTE crashes I see this section in a
> different way. Instead of the chars after 'accented=' I only see a lot
> of '?'.
> 
> If I change the encoding type in the file menu from 8bit to utf8 nothing
> happens excepts that a lot of pango warnings occur.

Try this:

1. convert properties files to utf-8 using iconv (or you can do it only
with your user properties file).

2. put these codepage settings in the Internationalisation section of the 
properties:

code.page=65001
output.code.page=65001

Comment out all other settings in this section.

-- 
Stanislav

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-23 Thread Stanislav Maslovski
Hello,

Here goes the 3rd version of the patch (attached).
  - focus behaviour corrected (finally?)
  - LayoutUI() is now called after the properties have been read
  - set minimum size hint to wContent

Please check.

-- 
Stanislav

On Tue, Aug 21, 2007 at 09:33:33AM +1000, Neil Hodgson wrote:
> Stanislav Maslovski:
> 
> >   - problem with cursors solved.
> 
>Using cursorInvalid in this way is good.
> 
> > >   - focus issues fixed.
> >
> > Oops, not all of them. When the output window is opened to
> > the maximum width the focus goes nowhere...
> 
>Its OK to be a bit heavy-handed, forcing the focus into a visible
> window even if it doesn't seem to be currently associated with an
> editing pane. That's better than any situation where typing goes
> nowhere.
> 
>   Neil
> ___
> Scite-interest mailing list
> Scite-interest@lyra.org
> http://mailman.lyra.org/mailman/listinfo/scite-interest

diff -urN scite-1.74-orig/scintilla/gtk/PlatGTK.cxx scite-1.74/scintilla/gtk/PlatGTK.cxx
--- scite-1.74-orig/scintilla/gtk/PlatGTK.cxx	2007-06-15 15:24:38.0 +0400
+++ scite-1.74/scintilla/gtk/PlatGTK.cxx	2007-08-23 11:53:24.847560293 +0400
@@ -1841,6 +1841,8 @@
 	cursorLast = curs;
 	GdkCursor *gdkCurs;
 	switch (curs) {
+	case cursorInvalid:
+		return;
 	case cursorText:
 		gdkCurs = gdk_cursor_new(GDK_XTERM);
 		break;
diff -urN scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx scite-1.74/scintilla/gtk/ScintillaGTK.cxx
--- scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx	2007-06-12 07:55:11.0 +0400
+++ scite-1.74/scintilla/gtk/ScintillaGTK.cxx	2007-08-23 11:53:24.847560721 +0400
@@ -568,6 +568,9 @@
 	gtk_widget_unmap(PWidget(wText));
 	gtk_widget_unmap(PWidget(scrollbarh));
 	gtk_widget_unmap(PWidget(scrollbarv));
+	wText.SetCursor(Window::cursorInvalid);
+	scrollbarv.SetCursor(Window::cursorInvalid);
+	scrollbarh.SetCursor(Window::cursorInvalid);
 }
 
 void ScintillaGTK::UnMap(GtkWidget *widget) {
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-06-13 18:09:09.0 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-23 14:18:04.023497756 +0400
@@ -307,11 +307,9 @@
 
 protected:
 
-	Window wDivider;
+	GtkWidget *splitPane;
 	Point ptOld;
 	GdkGC *xor_gc;
-	bool focusEditor;
-	bool focusOutput;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -497,11 +495,6 @@
 	static gint MousePress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	gint Mouse(GdkEventButton *event);
 
-	void DividerXOR(Point pt);
-	static gint DividerExpose(GtkWidget *widget, GdkEventExpose *ose, SciTEGTK *scitew);
-	static gint DividerMotion(GtkWidget *widget, GdkEventMotion *event, SciTEGTK *scitew);
-	static gint DividerPress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
-	static gint DividerRelease(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
 	 gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, SciTEGTK *scitew);
 
@@ -538,6 +531,7 @@
 	  int startID = 0, const char *radioStart = 0);
 	void CreateMenu();
 	void CreateUI();
+	void LayoutUI();
 	void Run(int argc, char *argv[]);
 	void ProcessExecute();
 	virtual void Execute();
@@ -595,6 +589,8 @@
 	btnBuild = 0;
 	btnStop = 0;
 	itemFactory = 0;
+	splitPane = 0;
+	heightBar = 0;
 
 	fileSelectorWidth = 580;
 	fileSelectorHeight = 480;
@@ -835,6 +831,13 @@
 		SizeSubWindows();
 		CheckMenus();
 		break;
+	// override base class
+	case IDM_SPLITVERTICAL:
+		splitVertical = !splitVertical;
+		heightBar = 0;
+		LayoutUI();
+		CheckMenus();
+		break;
 
 	default:
 		SciTEBase::MenuCommand(cmdID, menuSource);
@@ -888,30 +891,50 @@
 }
 
 void SciTEGTK::SizeContentWindows() {
-	PRectangle rcClient = GetClientRectangle();
-#if GTK_MAJOR_VERSION < 2
-	int left = 0;
-	int top = 0;
-#else
-	int left = rcClient.left;
-	int top = rcClient.top;
-#endif
-	int w = rcClient.right - rcClient.left;
-	int h = rcClient.bottom - rcClient.top;
-	heightOutput = NormaliseSplit(heightOutput);
-	if (splitVertical) {
-		wEditor.SetPosition(PRectangle(left, top, w - heightOutput - heightBar + left, h + top));
-		wDivider.SetPosition(PRectangle(w - heightOutput - heightBar + left, top, w - heightOutput + left, h + top));
-		wOutput.SetPosition(PRectangle(w - heightOutput + left, top, w + left, h + top));
-	} else {
-		wEditor.SetPosition(PRectangle(left, top, w + left, h - heightOutput - heightBar + top));
-		wDivider.SetPosition(PRectangle(left, h - heightOutput - heightBar + top, w + left, h - heightOutput + top));
-		wOutput.SetPosition(PRectangle(left, h - heightOutput + top, w + left, h + top));
+	if (splitPane) {
+		// we come here when receiving resizing signals
+		int height, heightEditor, 

Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-20 Thread Stanislav Maslovski
On Mon, Aug 20, 2007 at 07:48:32PM +0400, Stanislav Maslovski wrote:
> Hello,
> 
> A new version of the patch is ready.
>   - focus issues fixed.

Oops, not all of them. When the output window is opened to
the maximum width the focus goes nowhere...

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-20 Thread Stanislav Maslovski
Hello,

A new version of the patch is ready.
  - focus issues fixed.
  - problem with cursors solved.

Please check.

-- 
Stanislav


On Sun, Aug 19, 2007 at 12:15:23PM +1000, Neil Hodgson wrote:
>Hi Stanislav,
> 
> >   - cursorLast and the related code was removed because it did not work
> > with dynamically destroyed/created windows. This removal should
> > not affect the win32 code.
> 
>There are several other platforms (OS/X, wxWidgets, QT, ...) so
> published APIs like this should not change. It would also be better to
> get this code working on GTK+ to avoid unnecessary calls to
> gdk_window_set_cursor. This may now be optimized but I think there was
> flickering on old versions of GTK+.
> 
>There are new focus issues when switching between horizontal and
> vertical layouts. The focus seems to go nowhere so typing has no
> effect.
diff -urN scite-1.74-orig/scintilla/gtk/PlatGTK.cxx scite-1.74/scintilla/gtk/PlatGTK.cxx
--- scite-1.74-orig/scintilla/gtk/PlatGTK.cxx	2007-06-15 15:24:38.0 +0400
+++ scite-1.74/scintilla/gtk/PlatGTK.cxx	2007-08-20 19:21:05.0 +0400
@@ -1841,6 +1841,8 @@
 	cursorLast = curs;
 	GdkCursor *gdkCurs;
 	switch (curs) {
+	case cursorInvalid:
+		return;
 	case cursorText:
 		gdkCurs = gdk_cursor_new(GDK_XTERM);
 		break;
diff -urN scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx scite-1.74/scintilla/gtk/ScintillaGTK.cxx
--- scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx	2007-06-12 07:55:11.0 +0400
+++ scite-1.74/scintilla/gtk/ScintillaGTK.cxx	2007-08-20 19:21:45.0 +0400
@@ -568,6 +568,9 @@
 	gtk_widget_unmap(PWidget(wText));
 	gtk_widget_unmap(PWidget(scrollbarh));
 	gtk_widget_unmap(PWidget(scrollbarv));
+	wText.SetCursor(Window::cursorInvalid);
+	scrollbarv.SetCursor(Window::cursorInvalid);
+	scrollbarh.SetCursor(Window::cursorInvalid);
 }
 
 void ScintillaGTK::UnMap(GtkWidget *widget) {
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-06-13 18:09:09.0 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-20 17:55:32.0 +0400
@@ -307,11 +307,9 @@
 
 protected:
 
-	Window wDivider;
+	GtkWidget *splitPane;
 	Point ptOld;
 	GdkGC *xor_gc;
-	bool focusEditor;
-	bool focusOutput;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -497,11 +495,6 @@
 	static gint MousePress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	gint Mouse(GdkEventButton *event);
 
-	void DividerXOR(Point pt);
-	static gint DividerExpose(GtkWidget *widget, GdkEventExpose *ose, SciTEGTK *scitew);
-	static gint DividerMotion(GtkWidget *widget, GdkEventMotion *event, SciTEGTK *scitew);
-	static gint DividerPress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
-	static gint DividerRelease(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
 	 gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, SciTEGTK *scitew);
 
@@ -538,6 +531,7 @@
 	  int startID = 0, const char *radioStart = 0);
 	void CreateMenu();
 	void CreateUI();
+	void LayoutUI();
 	void Run(int argc, char *argv[]);
 	void ProcessExecute();
 	virtual void Execute();
@@ -595,6 +589,8 @@
 	btnBuild = 0;
 	btnStop = 0;
 	itemFactory = 0;
+	splitPane = 0;
+	heightBar = 0;
 
 	fileSelectorWidth = 580;
 	fileSelectorHeight = 480;
@@ -835,6 +831,13 @@
 		SizeSubWindows();
 		CheckMenus();
 		break;
+	// override base class
+	case IDM_SPLITVERTICAL:
+		splitVertical = !splitVertical;
+		heightBar = 0;
+		LayoutUI();
+		CheckMenus();
+		break;
 
 	default:
 		SciTEBase::MenuCommand(cmdID, menuSource);
@@ -888,30 +891,45 @@
 }
 
 void SciTEGTK::SizeContentWindows() {
-	PRectangle rcClient = GetClientRectangle();
-#if GTK_MAJOR_VERSION < 2
-	int left = 0;
-	int top = 0;
-#else
-	int left = rcClient.left;
-	int top = rcClient.top;
-#endif
-	int w = rcClient.right - rcClient.left;
-	int h = rcClient.bottom - rcClient.top;
-	heightOutput = NormaliseSplit(heightOutput);
+//	printf("SizeContentWindows: heightOutput = %d, prevHeightOutput = %d, heightBar = %d\n",
+//			heightOutput, previousHeightOutput, heightBar);
+	// we come here when receiving resizing signals
+	int height, bar;
 	if (splitVertical) {
-		wEditor.SetPosition(PRectangle(left, top, w - heightOutput - heightBar + left, h + top));
-		wDivider.SetPosition(PRectangle(w - heightOutput - heightBar + left, top, w - heightOutput + left, h + top));
-		wOutput.SetPosition(PRectangle(w - heightOutput + left, top, w + left, h + top));
+		height = PWidget(wOutput)->allocation.width;
+		bar = splitPane->allocation.width - PWidget(wEditor)->allocation.width - height;
 	} else {
-		wEditor.SetPosition(PRectangle(left, top, w + left, h - heightOutput - heightBar + top));
-		wDivider.SetPosition(PRectangle(left, h - heightOutput - heightBar + top, w + left, h - heightOutput + top));
-		wOutput.SetPositi

Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-18 Thread Stanislav Maslovski
On Sun, Aug 19, 2007 at 12:15:23PM +1000, Neil Hodgson wrote:
>Hi Stanislav,
> 
> >   - cursorLast and the related code was removed because it did not work
> > with dynamically destroyed/created windows. This removal should
> > not affect the win32 code.
> 
>There are several other platforms (OS/X, wxWidgets, QT, ...) so
> published APIs like this should not change.

Actually, this change should not be visible from the outside anyway,
because that cursorLast member is private and is not accessed directly.

But of course it is complitely possible to keep cursorLast in Platform.h.
It will not affect my code.

> It would also be better to
> get this code working on GTK+ to avoid unnecessary calls to
> gdk_window_set_cursor.

Yes, I would wish for the same. At the moment I do not understand
what happens with the cached cursors when wEditor and wOutput are removed
from their previous container and inserted into the new one. Maybe I could
tell these windows to reload cursors somehow? Can you give me a hint if this
is possible?

> This may now be optimized but I think there was
> flickering on old versions of GTK+.

I see.

> 
>There are new focus issues when switching between horizontal and
> vertical layouts. The focus seems to go nowhere so typing has no
> effect.

Oh, yes, I have not noticed. I will correct this.

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-18 Thread Stanislav Maslovski
Hello,

The attached patch replaces the hard-coded divider logic with one based on 
GtkPaned.

Features:
  - less code
  - dynamic change of the layout is still there
  - flicker when resizing the main editor window is greatly reduced
  - GtkPaned is themeable which means better interaction with the desktop 
environment

Notes:
  - cursorLast and the related code was removed because it did not work
with dynamically destroyed/created windows. This removal should not affect 
the win32 code.

Developed under libgtk2.0, version 2.8.20.

Please check.

With best regards,
Stanislav
diff -urN scite-1.74-orig/scintilla/gtk/PlatGTK.cxx scite-1.74/scintilla/gtk/PlatGTK.cxx
--- scite-1.74-orig/scintilla/gtk/PlatGTK.cxx	2007-06-15 15:24:38.0 +0400
+++ scite-1.74/scintilla/gtk/PlatGTK.cxx	2007-08-16 20:35:58.0 +0400
@@ -1833,12 +1833,6 @@
 }
 
 void Window::SetCursor(Cursor curs) {
-	// We don't set the cursor to same value numerous times under gtk because
-	// it stores the cursor in the window once it's set
-	if (curs == cursorLast)
-		return;
-
-	cursorLast = curs;
 	GdkCursor *gdkCurs;
 	switch (curs) {
 	case cursorText:
@@ -1861,7 +1855,6 @@
 		break;
 	default:
 		gdkCurs = gdk_cursor_new(GDK_LEFT_PTR);
-		cursorLast = cursorArrow;
 		break;
 	}
 
diff -urN scite-1.74-orig/scintilla/include/Platform.h scite-1.74/scintilla/include/Platform.h
--- scite-1.74-orig/scintilla/include/Platform.h	2007-06-01 04:57:21.0 +0400
+++ scite-1.74/scintilla/include/Platform.h	2007-08-16 20:37:00.0 +0400
@@ -373,13 +373,13 @@
 	void *control;
 #endif
 public:
-	Window() : id(0), cursorLast(cursorInvalid) {
+	Window() : id(0) {
 #ifdef PLAT_MACOSX
 	  windowRef = 0;
 	  control = 0;
 #endif
 	}
-	Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {
+	Window(const Window &source) : id(source.id) {
 #ifdef PLAT_MACOSX
 	  windowRef = 0;
 	  control = 0;
@@ -409,8 +409,6 @@
 	void SetWindow(void *ref) { windowRef = ref; };
 	void SetControl(void *_control) { control = _control; };
 #endif
-private:
-	Cursor cursorLast;
 };
 
 /**
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-06-13 18:09:09.0 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-18 17:59:52.0 +0400
@@ -307,11 +307,9 @@
 
 protected:
 
-	Window wDivider;
+	GtkWidget *splitPane;
 	Point ptOld;
 	GdkGC *xor_gc;
-	bool focusEditor;
-	bool focusOutput;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -497,11 +495,6 @@
 	static gint MousePress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	gint Mouse(GdkEventButton *event);
 
-	void DividerXOR(Point pt);
-	static gint DividerExpose(GtkWidget *widget, GdkEventExpose *ose, SciTEGTK *scitew);
-	static gint DividerMotion(GtkWidget *widget, GdkEventMotion *event, SciTEGTK *scitew);
-	static gint DividerPress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
-	static gint DividerRelease(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
 	 gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, SciTEGTK *scitew);
 
@@ -538,6 +531,7 @@
 	  int startID = 0, const char *radioStart = 0);
 	void CreateMenu();
 	void CreateUI();
+	void LayoutUI();
 	void Run(int argc, char *argv[]);
 	void ProcessExecute();
 	virtual void Execute();
@@ -595,6 +589,8 @@
 	btnBuild = 0;
 	btnStop = 0;
 	itemFactory = 0;
+	splitPane = 0;
+	heightBar = 0;
 
 	fileSelectorWidth = 580;
 	fileSelectorHeight = 480;
@@ -835,6 +831,13 @@
 		SizeSubWindows();
 		CheckMenus();
 		break;
+	// override base class
+	case IDM_SPLITVERTICAL:
+		splitVertical = !splitVertical;
+		heightBar = 0;
+		LayoutUI();
+		CheckMenus();
+		break;
 
 	default:
 		SciTEBase::MenuCommand(cmdID, menuSource);
@@ -888,30 +891,45 @@
 }
 
 void SciTEGTK::SizeContentWindows() {
-	PRectangle rcClient = GetClientRectangle();
-#if GTK_MAJOR_VERSION < 2
-	int left = 0;
-	int top = 0;
-#else
-	int left = rcClient.left;
-	int top = rcClient.top;
-#endif
-	int w = rcClient.right - rcClient.left;
-	int h = rcClient.bottom - rcClient.top;
-	heightOutput = NormaliseSplit(heightOutput);
+//	printf("SizeContentWindows: heightOutput = %d, prevHeightOutput = %d, heightBar = %d\n",
+//			heightOutput, previousHeightOutput, heightBar);
+	// we come here when receiving resizing signals
+	int height, bar;
 	if (splitVertical) {
-		wEditor.SetPosition(PRectangle(left, top, w - heightOutput - heightBar + left, h + top));
-		wDivider.SetPosition(PRectangle(w - heightOutput - heightBar + left, top, w - heightOutput + left, h + top));
-		wOutput.SetPosition(PRectangle(w - heightOutput + left, top, w + left, h + top));
+		height = PWidget(wOutput)->allocation.width;
+		bar = splitPane->allocation.width - PWidget(wEditor)->allocation.width - height;
 	} else {
-		wEditor.SetPosition(