Date: Sat, 22 Apr 2006 19:05:27 +1000 From: Erik de Castro Lopo To: lablgtk at math.nagoya-u.ac.jp Subject: Re: Setting the cursor in a text_view object Message-Id: <20060422190527.094d0aa6.erikd at mega-nerd.com> In-Reply-To: <20060421134912.5de86566.ocaml-erikd at mega-nerd.com> References: <20060421134912.5de86566.ocaml-erikd at mega-nerd.com> Organization: Erik Conspiracy Secret Labs x-gpg-fingerprint: 7357 1E85 C19F 4281 D8C9 7AA8 6CA4 1A77 43B8 D6C8 x-gpg-key: 43B8D6C8 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 1435 Erik de Castro Lopo wrote: > I need to change the cursor in a text_view object. I figured out > how to do this in C; you need to hook the "realize" callback and > then do a gtk_window_set_cursor there. Ok, its all down to this line: Gdk.Window.set_cursor tview#misc#window (Gdk.Cursor.create `LEFT_PTR) ; which for some reason is not doing the same as the C/GTK+ equivalent: gdk_window_set_cursor ( gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), cursor) ; Looking at the C/GTK+ docs here: http://developer.gnome.org/doc/API/2.2/gtk/GtkTextView.html#gtk-text-view-get-window we see that the get_window function requires a second paramater (GTK_TEXT_WINDOW_TEXT) which is one of these values: http://developer.gnome.org/doc/API/2.2/gtk/GtkTextView.html#GtkTextWindowType In the C version, the cursor is only changed if the second parameter is GTK_TEXT_WINDOW_TEXT; none of the other values work. My suspicion (as yet unproved) is that the Ocaml version is failing due to an incorrect value of this second value. My debugging continues. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ Open Source and Free Software means that you never sacrifice quality of the code for meeting deadlines set up by people not participating directly in the software development process.