Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] InputMethod problem with SWT(gtk2.0)

To build the swt gtk libraries you can invoke the build.csh script that's
in the same directory as the swt.c that you edited.  This source directory
should always contain everything that's needed to build these libraries.

Grant



|---------+---------------------------------->
|         |           Takashi Okamoto        |
|         |           <toraneko@xxxxxxxxx>   |
|         |           Sent by:               |
|         |           platform-swt-dev-admin@|
|         |           eclipse.org            |
|         |                                  |
|         |                                  |
|         |           06/02/2002 02:04 AM    |
|         |           Please respond to      |
|         |           platform-swt-dev       |
|         |                                  |
|---------+---------------------------------->
  >-----------------------------------------------------------------------------------------------------------|
  |                                                                                                           |
  |        To:      platform-swt-dev@xxxxxxxxxxx                                                              |
  |        cc:                                                                                                |
  |        Subject: Re: [platform-swt-dev] InputMethod problem with SWT(gtk2.0)                               |
  >-----------------------------------------------------------------------------------------------------------|



From: Boris_Shingarov@xxxxxxx
Subject: Re: [platform-swt-dev] InputMethod problem with SWT(gtk2.0)
Date: Mon, 27 May 2002 13:00:06 -0400

> Eclipse 2.0 will definitely ship with GtkText, GtkCList and GtkCTree.
> There is certainly not enough time to introduce this much destabilization

> of code at this stage.  Once we hit 2.0, though, the first thing to do
> will be moving to the correct widgets.

At least, I want to replace GtkTextView for Japanse. So, I wrote a
patch briefly which is attached this mail. But I never test it because
I don't know how I build libswt-gtk-2040.so (or
libswt-pi-gtk-2040.so?) from source.

It may be new bee's question but "How can I build SWT from source?"

regards,

Takashi Okamoto
--- swt.c.orig           Sun May 26 21:56:44 2002
+++ swt.c          Sun Jun  2 14:46:47 2002
@@ -3193,8 +3193,8 @@
             (JNIEnv *env, jclass that, jint arg0)
 {
             DEBUG_CALL("gtk_1text_1get_1length\n")
-
-            return (jint)gtk_text_get_length((GtkText *)arg0);
+            GtkTextBuffer *gtb = gtk_text_view_get_buffer((GtkTextView
*)arg0);
+            return (jint)gtk_text_buffer_get_char_count(gtb);
 }

 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1new
@@ -3202,7 +3202,7 @@
 {
             DEBUG_CALL("gtk_1text_1new\n")

-            return (jint)gtk_text_new((GtkAdjustment *)arg0,
(GtkAdjustment *)arg1);
+            return (jint)gtk_text_view_new((GtkAdjustment *)arg0,
(GtkAdjustment *)arg1);
 }

 JNIEXPORT void JNICALL
Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1set_1editable
@@ -3210,15 +3210,17 @@
 {
             DEBUG_CALL("gtk_1text_1set_1editable\n")

-            gtk_text_set_editable((GtkText *)arg0, (gboolean)arg1);
+            gtk_text_view_set_editable((GtkTextView *)arg0,
(gboolean)arg1);
 }

 JNIEXPORT void JNICALL
Java_org_eclipse_swt_internal_gtk_OS_gtk_1text_1set_1word_1wrap
             (JNIEnv *env, jclass that, jint arg0, jint arg1)
 {
             DEBUG_CALL("gtk_1text_1set_1word_1wrap\n")
-
-            gtk_text_set_word_wrap((GtkText *)arg0, (gboolean)arg1);
+            gtk_text_view_set_wrap_mode((GtkTextView *)arg0,
+                                                (arg1==true)
+                                                ?GtkWrapMode.GTK_WARP_WORD
+
:GtkWrapMode.GTK_WARP_NONE);
 }

 JNIEXPORT jint JNICALL
Java_org_eclipse_swt_internal_gtk_OS_gtk_1timeout_1add






Back to the top