how copy gchar* pointer to other gchar*, send two widgets refs to callback function ?
- From: Mario Lopez <mariotpc gmail com>
- To: Gtk Developer List <gtk-devel-list gnome org>
- Subject: how copy gchar* pointer to other gchar*, send two widgets refs to callback function ?
- Date: Tue, 1 Mar 2005 15:01:26 -0600
Greetings ....
I want to ask something to them about this function
/**************************************** FUNCTION
*****************************************/
void on_btnEnviar_clicked (GtkButton *button, gpointer user_data)
{
GtkTextIter start;
GtkTextIter end;
GtkWidget *dialog;
GtkTextBuffer* text_buffer=0;
gchar* buf=0;
gchar* msg=0;
text_buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(user_data));
gtk_text_buffer_get_start_iter(text_buffer,&start);
gtk_text_buffer_get_end_iter(text_buffer,&end);
buf=gtk_text_buffer_get_text(text_buffer,&start, &end,TRUE);
//msg = "net send /domain:teacher ";
//strcpy (msg,buf);
dialog = gtk_message_dialog_new(NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"El mensaje : %s\n Fue enviado satisfactoriamente ...", buf);
/*WinExec( msg, SW_MINIMIZE ) */
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
g_free(buf);
};
/**************************************** END FUNCTION
******************************************/
as you can see... I want to copy the content of buf to msg to having
in the msg = "net send /domain:teacher and the message that user want
to send...."
but when copying the content the program crash...
another question....
void on_btnEnviar_clicked (GtkButton *button, gpointer user_data)
recives at user_data a reference to textview widget, but how can
recive the textview and other widget ? by example a reference to
combobox, something like.
void on_btnEnviar_clicked (GtkButton *button, gpointer textview,
gpointer cbowho)
thankX....
/********************************************************************
Mario Enrique López Guzmán
mariotpc gmail com
cancuen.berlios.de
*********************************************************************/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]