Re: Char = GtkWidget *entry_host
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Wilton <wrwonrath yahoo com br>
- Cc: gtk-list gnome org
- Subject: Re: Char = GtkWidget *entry_host
- Date: Sat, 8 Oct 2005 20:35:21 +0200
On Sat, Oct 08, 2005 at 01:18:22PM -0300, Wilton wrote:
>
> entry_host = gtk_entry_new ();
> gtk_entry_set_max_length(GTK_ENTRY (entry_host),50);
> gtk_entry_set_text(GTK_ENTRY (entry_host),"localhost");
> gtk_box_pack_start(GTK_BOX (vbox), entry_host, TRUE, TRUE, 0);
> gtk_widget_show(entry_host);
>
> Now I want to use the value entered in this field in another global
> variable like this:
>
> char host[256];
>
> But the types are incompatible. How can I solve this problem?
You have to connect to "changed" signal of the entry and
update host whenever the entry changes. I do not see any
incompatibility between the const gchar* return value of
gtk_entry_get_text() and a char[256] variable -- you can
normally use g_strlcpy() (for example).
Yeti
--
That's enough.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]