gtk_entry_get_text + strange Segmentation fault



Hi

i've something like this:

class win{
   GTKWIDGET *window, *input;

public: 
// windows
  // create the default configure window
  int createWindow();
     // callback
     void WindowOKButtonClicked();

  // save values
  int saveValues();

};


static void st_WindowOKButtonClicked(GtkWidget *widget, win *object){
  object->WindowOKButtonClicked();
}



int win::createWindow(){
    GTKWIDGET *button;

/* some code which creates a nice window */


   button = gtk_button_new_with_label(" OK ");
   gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
   gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(st_WindowOKButtonClicked), this);

/* more code */
}



/*
  Callbacks - handle clicked buttons in Window
*/
void win::WindowOKButtonClicked(){
    saveValues();
    gtk_widget_destroy(GTK_WIDGET(window));
}



int win::saveValues() {
  
  char *cBuffer;
  cBuffer = (char *)malloc(sizeof(unsigned int)*8+1);
  
  if(configInput1 != NULL){cerr << "configInput1 != 0"<<endl;}



/************
  problem line
***************/
  cBuffer = gtk_entry_get_text(GTK_ENTRY(input));




  free(cBuffer);
        
return 1;
}// end configSave()





If i comment 
  cBuffer = gtk_entry_get_text(GTK_ENTRY(configInput1));
out, everything works fine. But if i use this line i get a "Segmentation fault" AFTER correct execution of 
win::WindowOKButtonClicked.
I've no $%&/ clue why this appears.
Any suggestions??

THX
marc(..)





-- 

-----------------------------------------------------------------
Hast Du noch 30pin SIMM RAM??
Oder einen Socket 3 Prozessor??
Oder ein Terminal??
Willst Du ne gute Tat tun??
Gib's  mir!!

==================================================================
Ich widerspreche der Nutzung oder Uebermittlung meiner Daten fuer
Werbezwecke oder fuer die Markt- oder Meinungsforschung (§ 28 Abs.3
BDSG)



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