step values to a function?
- From: <javiercmx correo unam mx>
- To: <gtk-app-devel-list gnome org>
- Subject: step values to a function?
- Date: Fri, 13 Jul 2001 10:51:11 -0500
Hi
I have a problem, I write this code
static GtkWidget *PackNewForm(gint homogeneous,gint spacing,gint expand,gint
fill,gint padding,gint flag,char *szlabel)
{
GList *cbitems=NULL;
GtkWidget *box;
GtkWidget *button;
GtkWidget *combo;
GtkWidget *login;
GtkWidget *passwd;
GtkWidget *central;
GtkWidget *plantel;
GtkWidget *label;
GtkWidget *entry;
box=gtk_hbox_new(homogeneous,spacing);
if(flag==0)
{
label=gtk_label_new(szlabel);
gtk_box_pack_start(GTK_BOX(box),label,expand,fill,padding);
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 (ConectaBase), &login);
gtk_entry_set_text(GTK_ENTRY(login),"avega");
gtk_box_pack_start(GTK_BOX(box),login,expand,fill,padding);
gtk_widget_show(login);
return(box);
}
else if(flag==1)
{
label=gtk_label_new(szlabel);
gtk_box_pack_start(GTK_BOX(box),label,expand,fill,padding);
gtk_widget_show(label);
passwd=gtk_entry_new();
gtk_widget_set_usize(passwd,155,-1);
gtk_entry_set_visibility(GTK_ENTRY(passwd),TRUE);
gtk_signal_connect (GTK_OBJECT (passwd), "activate",
GTK_SIGNAL_FUNC (ConectaBase), &passwd);
gtk_box_pack_start(GTK_BOX(box),passwd,expand,fill,padding);
gtk_widget_show(passwd);
return(box);
}
else if(flag==2)
{
label=gtk_label_new(szlabel);
gtk_misc_set_alignment(GTK_MISC(label),1,0);
gtk_box_pack_start(GTK_BOX(box),label,expand,fill,padding);
gtk_widget_show(label);
central=gtk_combo_new();
gtk_widget_set_usize (central, 170, -1);
// gtk_signal_connect (GTK_OBJECT (GTK_COMBO (central)-
entry), "changed",
// GTK_SIGNAL_FUNC (central), NULL);
//if (host_history) gtk_combo_set_popdown_strings (GTK_COMBO (hostedit),
host_history);
gtk_combo_disable_activate (GTK_COMBO (central));
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (central)->entry), "");
gtk_box_pack_start(GTK_BOX(box),central,expand,fill,padding);
gtk_widget_show(central);
gtk_widget_show_all(box);
return(box);
}
else if(flag==3)
{
label=gtk_label_new(szlabel);
gtk_misc_set_alignment(GTK_MISC(label),1,0);
gtk_box_pack_start(GTK_BOX(box),label,expand,fill,padding);
gtk_widget_show(label);
plantel=gtk_combo_new();
gtk_widget_set_usize(plantel,170,-1);
//gtk_signal_connect (GTK_OBJECT (GTK_COMBO (plantel)->entry), "changed",
// GTK_SIGNAL_FUNC (ConectaBase), NULL);
gtk_combo_disable_activate(GTK_COMBO(plantel));
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(plantel)->entry),"");
gtk_box_pack_start(GTK_BOX(box),plantel,expand,fill,padding);
gtk_widget_show(plantel);
gtk_widget_show_all(box);
return(box);
}
}
/*GtkWidget *PackButton(GtkWidget *bbox,char *szlabel)
{
GtkWidget *button;
button=gtk_button_new_with_label(szlabel);
gtk_box_pack_start(GTK_BOX(bbox),button,FALSE,FALSE,0);
gtk_widget_show(button);
}
......
......
......
hbox=PackNewForm(FALSE,0,FALSE,TRUE,8,0,"Usuario:");
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,10);
hbox=PackNewForm(FALSE,0,FALSE,TRUE,8,1,"Passwd:");
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,10);
.....
.....
button=gtk_button_new_with_label("Conectar");
// gtk_signal_connect(GTK_OBJECT(button),"clicked",GTK_SIGNALFUNC
(ConectaBase),NULL);
button=gtk_button_new_with_label("Cancelar");
gtk_signal_connect(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC
(CloseApp),NULL);
PackNewForm is a widget which has entry text, these entry must fill with login,
password, and server to conect, my problem is how to write a funtion to pass
login, passwdord and server, when to press the button to connect to server
I need to receive the values in this function
ServerConect(char *login, char *passwd, char *server1, char *server2)
{
...
}
THANKS Javier
-------------------------------------------------
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]