[Glade-users] GtkEntry

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

have a nice day,

2014-06-11 1:26 GMT+02:00 Ian Chapman <ichapman at videotron.ca>:
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.
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 ;



text = gtk_entry_get_text( GTK_ENTRY(myEntry));

Glade-users maillist  -  Glade-users at lists.ximian.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]