Re: GtkEntry
Domenico Ferrari <[email protected]> Wed, 11 Jun 2014 10:00:30 +0200
| Newsgroups | gmane.comp.gnome.glade.user |
|---|---|
| Message-ID | <CAKeX1Aq_Ci_Bfe7Opn0eTenJD=UdxnJgYSdphnbidv2vPmr5Tg@mail.gmail.com> |
Hi Ian. Some hints... To get the entry object from GtkBuilder GtkWidget *entry1=GTK_WIDGET(gtk_builder_get_object(builder, "entry1")); set the text gtk_entry_set_text(GTK_ENTRY(entry1), "some text"); and then get the text text = gtk_entry_get_text( GTK_ENTRY(entry1)); see the manual at https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-get-object have a nice day, Dome 2014-06-11 1:26 GMT+02:00 Ian Chapman <[email protected]>: > Thanks Dome, > This code you sent me compiled so that's a step forward. As I > understand it "myEntry=gtk_entry_new(); " creates a new widget. Going back > to my original post, "I have In glade 3.14.2 I have window with a container > box and in one of the compartments of the box I have Text Entry that shows > in the inspector as GtkEntry (FileName)". I'm not able to connect what you > have to what I have in glade. I can connect and service signals from glade > and now I want to initiate a action on GtkEntry(FileName) so as to read and > write into the test field. Please help Ian. > PS > I'm using old glade2 tutorials and the manual > https://developer.gnome.org/gtk3/stable/GtkEntry.html which is rater terse. > I need to find more on macros. > > > On 06/10/2014 05:22 AM, Domenico Ferrari wrote: >> >> You should use GTK_ENTRY instead of a direct cast because GTK_ENTRY >> does type checking. >> >> GtkWidget *myEntry; >> const char* text ; >> >> myEntry=gtk_entry_new(); >> >> ... >> >> text = gtk_entry_get_text( GTK_ENTRY(myEntry)); >> >> >> Cheers, >> Dome >> _______________________________________________ >> Glade-users maillist - [email protected] >> http://lists.ximian.com/mailman/listinfo/glade-users >> > _______________________________________________ Glade-users maillist - [email protected] http://lists.ximian.com/mailman/listinfo/glade-users