Find the answer to your Linux question:
Results 1 to 2 of 2
Dear, I'm trying to build a really simple GUI. I'm doing this in C and Glade. The problem that i have right now, is that i can't run the btn_clicked ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    3

    Gtk


    Dear,

    I'm trying to build a really simple GUI. I'm doing this in C and Glade. The problem that i have right now, is that i can't run the btn_clicked handler. I always get the message segmentation fault.

    Anybody an id?

    Code:
    void on_window_destroy (GtkObject *object, gpointer user_data){
            gtk_main_quit();
    }
    
    
    void btn_clicked(GtkButton *button, gpointer label){
    	gtk_label_set_text(GTK_LABEL("testjen"), "5");
    }
    
    
    
    int main (int argc, char *argv[]){
            GtkBuilder              *builder;
            GtkWidget               *window;
            
            gtk_init (&argc, &argv);
            
            builder = gtk_builder_new ();
            gtk_builder_add_from_file (builder, "gui.glade", NULL);
    
            window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
            gtk_builder_connect_signals (builder, NULL);        
    
    	    g_object_unref (G_OBJECT (builder));
            
            gtk_widget_show (window);       
            gtk_main ();
            
            return 0;
    }
    Thanks in advance

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    I don't exactly remember this stuff now.(I hope someone will answer about your question) -a project like isPrime | Free Science & Engineering software downloads at SourceForge.net helped a lot to understand glade and gtk.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •