Delivered-To: lablgtk at yquem.inria.fr Date: Thu, 27 Mar 2008 09:19:35 +0900 (JST) Message-Id: <20080327.091935.90767629.garrigue at math.nagoya-u.ac.jp> To: rathereasy at gmail.com Subject: Re: [Lablgtk] getting the origin of a window From: Jacques Garrigue In-Reply-To: References: <20080326.152926.21593485.garrigue@math.nagoya-u.ac.jp> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: lablgtk at yquem.inria.fr Content-Type: Text/Plain; charset=us-ascii Content-Length: 1580 I see, now all your questions make sense. Since you don't want that other window to be decorated, and want to put it at this precise position, gdk_window_get_position (as currently) is the right function, and gtk_window_get_position would give you a different result. Jacques From: "Jacques Le Normand" > I want to place another window at those coordinates, similar to what > spellcheckers do (they place a window beside a word and give you possible > options) > > On Wed, Mar 26, 2008 at 2:29 AM, Jacques Garrigue < > garrigue@math.nagoya-u.ac.jp> wrote: > > > From: "Jacques Le Normand" > > > > > I need to get to get the coordinates of a position in a textview. > > Consider > > > this function: > > > > > > let get_coordinates_at_offset buffer view i = > > > let iter = buffer#get_iter (`OFFSET i) in > > > let rectangle = view#get_iter_location iter in > > > let x_origin,y_origin = Gdk.Window.get_position w#misc#window in > > > (rectangle.x+x_origin,rectangle.y+y_origin) > > > > > > which takes a textbuffer and a textview and an offset and returns the > > (x,y) > > > coordinate of the offset. Is this correct? Or do I need > > > gtk_window_get_position(window,&x,&y) ? > > > > I'm not sure why you need the absolute coordinates of the position > > rather than the relative, but this doesn't seem to require > > gtk_window_get_position. > > > > Jacques > > _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk