Date: Wed, 10 Aug 2005 12:53:49 +0900 (JST) Message-Id: <20050810.125349.79297434.garrigue at math.nagoya-u.ac.jp> To: shoh at compiler.kaist.ac.kr Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Two question about selection From: Jacques Garrigue In-Reply-To: <42F96DA8.7050003 at compiler.kaist.ac.kr> References: <42F96DA8.7050003 at compiler.kaist.ac.kr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: SooHyoung Oh > I'm planning to update Lablgtk tutorial's "Manageing Selection" part > as Gtk tutorial http://www.gtk.org/tutorial/ . > I have two question about how to use "selection" in lablgtk? > Can anyone help me? > > Q1) How to analysis "ATOM" in Lablgtk? See the Gdk.Atom module. > Q2) On "17.3 Supplying the selection", they uses "gtk_selection_owner_set". > In lablgtk, we can do the same thing with "misc#grab_selection". > Then how can we do job such as gtk_selection_owner_set(NULL, ...)? > Do I have to implement "misc#ungrab_selection" > or is there any method already implmented? Good point. This is not available. This often happens when NULL is a special case... There are various workarounds: specifying the selection to be an empty string, or destroying the widget which holds the selection. Note also that the simplest way to handle the selection is to go through the GData.clipboard class. Two of them are predefined: GMain.selection and GMain.clipboard. And there is a method clipboard#clear. Which by the way means that GMain.selection#clear () should actually clear the selection anyway :-) Jacques