Help, how write a program to conect a server...
- From: <javiercmx correo unam mx>
- To: <gtk-app-devel-list gnome org>
- Subject: Help, how write a program to conect a server...
- Date: Tue, 17 Jul 2001 13:18:15 -0500
Hello
excuse me, I write a program which is connected a server, I was seeing his code
of gftp, but I do not understand some things.
I need to know, how to get the text in GtkEntry and GtkCombo for example the
code is:
include <gtk/gtk.h>
....
struct register
{
char *user;
char *clav;
char *srv;
} host;
...
label=gtk_label_new("User");
gtk_box_pack_start(GTK_BOX(box),label,TRUE,8,0)
gtk_widget_show(label);
login=gtk_entry_new();
gtk_widget_set_usize(login,155,-1);
gtk_signal_connect(GTK_OBJECT(login),"activate",
GTK_SIGNAL_FUNC(login), login)
label=gtk_label_new("Passwd");
gtk_box_pack_start(GTK_BOX(box),label,TRUE,10,0)
gtk_widget_show(label);
passwd=gtk_entry_new();
gtk_widget_set_usize(login,155,-1);
gtk_signal_connect(GTK_OBJECT(passwd),"activate",
GTK_SIGNAL_FUNC(passwd), passwd)
label=gtk_label_new("Server");
gtk_box_pack_start(GTK_BOX(box),label,TRUE,10,0)
gtk_widget_show(label);
server=gtk_combo_new();
gtk_widget_set_usize(170,-1);
gtk_signal_connect(GTK_OBJECT(GTK_COMBO(server)->entry,"activate",
GTK_SIGNAL_FUNC,server)
gtk_combo_disable_activate(GTK_COMBO(server));
gtk_box_pack_start(GTK_BOX(box),server,TRUE,10,0)
this is a widget with User:, Passwd, and server.
User and passwd use a GtkEntry
server use a GtkCombo
the functions that they are called are:
for User is
void login(GtkWidget *widget, gpointer data)
{
gchar tmplog;
tmplog=gtk_entry_get_text(GTK_ENTRY(data));
strcpy(host.user,tmplog);
}
for Passwd is
void passwd(GtkWidget *widget, gpointer data)
{
gchar tmppass;
tmppass=gtk_entry_get_text(GTK_ENTRY(data));
strcpy(host.clav,tmppass);
}
for server is
void server(GtkWidget *widget, gpointer data)
{
gchar tmpsrv;
tmpsrv=gtk_entry_get_text(GTK_ENTRY(data));
strcpy(host.srv,tmpsrv);
}
......
when press de button conect call de function call_host
the function is
void call_host(GtkWidget *widget, gpointer data)
{
ServerConnect();
}
In the function ServerConnect write the code that it makes the connection to the
server. this function
int ServerConect(void);
{
...
}
My problem is when write de user, passwd and server in the widget and press the
button connect, appears the following message:
Illegal instruction(core dumped)
not where this my error or of which another form can be done
any idea?
THANKS
-------------------------------------------------
Obtén tu correo en www.correo.unam.mx
UNAMonos Comunicándonos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]