From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48ddc60f3ebcf8b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-05 02:13:45 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!enews.sgi.com!telocity-west!TELOCITY!newsrump.sjc.telocity.net!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada References: <3AA2F492.FD660389@home.com> Subject: Re: Help Needed for Win32 GtkAda "Paste" to Clipboard MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: X-Trace: OTQgTm9BdXRoVXNlciBURUxPQ0lUWS1SRUFERVJTIDIxNi4yMjcuNDcuNDkgIE1vbiwgMDUgTWFy!IDIwMDEgMDI6MDk6MjggUFNU X-Abuse-Info: Please forward ALL headers when reporting abuse. X-Complaints-To: abuse@telocity.net NNTP-Posting-Date: Mon, 05 Mar 2001 02:09:28 PST Date: Mon, 5 Mar 2001 04:09:34 -0600 Xref: supernews.google.com comp.lang.ada:5422 Date: 2001-03-05T04:09:34-06:00 List-Id: You might get a quicker and more knowledgeable response from the GTKAda list AT gtkada@gtkada.eu.org. Information on subscribing is at http://gtkada.eu.org/mailman/listinfo/gtkada David C. Hoos, Sr. W1DCH "Warren W. Gay VE3WWG" wrote in message news:3AA2F492.FD660389@home.com... > Ok.. I surrender. I've beat my brain against the wall to much > on this one already.... > > What I want to do, is paste a password(string) from my GtkAda > key_chain app, to the Windows clipboard. I've seen some > pretty complicated Drag and Drop code etc., and even some cut > and paste code in C, for Gtk+. However, I am still not getting > very far in my attempt to paste a simple string to the clipboard. > > If someone has better GtkAda instructions/example code somewhere, > that would help. The GtkAda documentation doesn't tell you enough, > and what I could find, the examples don't cut it either. Even worse, > I suspect that the "procedure" has changed, but the documentation > has not kept pace. > > DESCRIPTION: > > In my Main_Win_Pkg, I have: > > The_Clipboard: Gdk_Selection; > > delcared in the spec. It is initialized, with: > > The_Clipboard := Gdk.Property.Atom.Itern("CLIPBOARD"); > > Later, after the windows 'n widgets are created, I have: > > Add_Target(Main_Win.Ed_Password,The_Clipboard,Target_String,1); > > Return_Callback.Connect > (Main_Win.Ed_Password, "selection_clear_event", > On_Cb_Copy_Password_Selection_Clear_Event'Access); > > Entry_Callback.Connect > (Main_Win.Ed_Password, "selection_get", > On_Cb_Copy_Password_Selection_Get'Access); > > The widget Main_Win.Ed_Password is a Gtk_Entry widget. > > With these calls in place, I now finally get the "selection_get" event > and callback (the C example I had used a checkbox, but they don't get > these events anymore it seems). > > The On_Cb_Copy_Password_Selection_Get callback, looks as follows: > > procedure On_Cb_Copy_Password_Selection_Get > (Object : access Gtk_Entry_Record'Class; > Params : Gtk.Arguments.Gtk_Args) > is > Data : Selection_Data := Selection_Data( To_C_Proxy(Params,1) ); > Arg2 : Guint := To_Guint (Params, 2); > Arg3 : Guint := To_Guint (Params, 3); > begin > Selection_Data_Set(Data,Selection_Type_String,8,""); > end On_Cb_Copy_Password_Selection_Get; > > The ownership of the clipboard is established in the toggle-button's > callback as follows: > > Flg := Owner_Set(Gtk_Widget(Main_Win.Ed_Password),The_Clipboard); > > With this code, I now get a paste of the string "" to > appear in notepad. HOWEVER, when I select a piece > of text in notepad (or anywhere else), I do _NOT_ get the > "selection_clear_event" callback event. > > Even worse, when I exit my > app, and restart it, then attempt to paste into the same notepad (that > was still running), it then pauses for a time, and then brings up a > printer dialog after I have pressed Shift-INS in notepad. Clearly, things > are not working correctly yet. > > These experiences are occurring under Windows 2000, using GNAT 3.13p > using GtkAda 1.2.10. > > I get the feeling that the whole cut and paste "procedure" underwent > some change in GtkAda and/or Gtk+, but can find mightly little > documentation on this. I only need to "copy" a string to the clipboard. > Nothing else. > > TIA, Warren. > -- > Warren W. Gay VE3WWG > http://members.home.net/ve3wwg