Message-ID: <43A7C8DC.20405 at tin.it> Date: Tue, 20 Dec 2005 10:03:24 +0100 From: Stalkern 2 MIME-Version: 1.0 CC: lablgtk at math.nagoya-u.ac.jp Subject: Re: "ocaml_beginners"::[] cursor References: <43A32D95.4030105 at tin.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit (Cross-posting from the ocaml-beginners ML...) mark samir wrote: > Dear Mr. Ernesto and Mr. Jones > Thank you for your reply. I think that I should explain my problem more. In > the GUI of program, there are two editors that user can type in them. Also > there is an Edit menu and in this menu there are three options for Cut,Copy > and Past. When a user selects one of these options, first, I should > determine that which editor is active editor and then I can do the > appropriate command. Active editor is editor which the cursor is in that. My > problem is that I could not find any function in the GTK library that can be > used for this purpose. > Thanks, > Mark I think that I can see the problem here: if you have a dropdown menu, the cursor would _leave_ the editor window to reach it. You could set a popup menu at mouse position, but you would likely loose the position of the text iter, that is very important too. You can then add to some widget (likely the GText.view itself) a event `ENTER_NOTIFY and set a callback for it so that the cursor declares that it entered one particular widget (one particular editor) to the callbacks in the dropdown menu. I'm assuming that your editors work like the examples/editor.ml file in the LABLGTK2 distribution. I don't know how one manages different clipboards. BTW: there is a LABLGTK list. For LABLGTK issues, please use that rather than the ocaml-beginners one. Thanks Ernesto