GTK newbie help on G_CALLBACK

Discussion in 'C Programming' started by bnrj.rudra@gmail.com, May 6, 2012.

  1. Guest

    Dear Friends,
    This is a question on GTK, but failed to find a forum on that. Since GTK is based on C, posting here with fingers crossed.
    I have taken a project (my own, not homework) to develop a table. I
    generally work with fortran, dont know C that much.
    What I want is a gtk clist to pop up when I press a button, via
    callback. The button widget in my code is


    /* Create first button */
    button = gtk_button_new_with_label ("B1");

    /* When the button is clicked, we call the "callback" function
    * with a pointer to "button 1" as its argument */
    g_signal_connect (button, "clicked",
    G_CALLBACK (callback), (gpointer) "B1");


    /* Insert button 1 into the upper left quadrant of the table */
    gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1);

    gtk_widget_show (button);
    The definations are mostly based on
    http://developer.gnome.org/gtk-tutorial/2.24/x344.html

    What I want to do is callback to execute another gtk file(a clist),
    rather than what shown in the example

    Code:
    static void callback( GtkWidget *widget,
    gpointer data ) {
    g_print ("Hello again - %s was pressed\n", (gchar *) data);
    }
    Can you please show me how I can get this?
     
    , May 6, 2012
    #1
    1. Advertising

  2. wrote:
    > Dear Friends,
    > This is a question on GTK, but failed to find a forum on that.


    What about all the mailing lists about GTK+ you find at

    http://www.gtk.org/mailing-lists.php

    There also seem to be some fora but I have no idea how
    good they are (and e.g. www.gtkforums.com seems to suffer
    from a massive attack by spammers at the moment).

    > Since GTK is based on C, posting here with fingers crossed.


    No luck;-) This is all about how to use a certain library out
    of probably millions written in C. You will need people with
    knowledge about this specific library (beside C) to solve your
    problem so I guess you will really be better off if you ask
    in a place where discussions about GTK+ is the main topic.

    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, May 6, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ads

    GTK help

    ads, Sep 17, 2003, in forum: Python
    Replies:
    1
    Views:
    461
    David M. Cook
    Sep 17, 2003
  2. Alexandre Rogers

    [newbie] GTK+/QT/Tkinter ?

    Alexandre Rogers, Nov 7, 2003, in forum: Python
    Replies:
    4
    Views:
    727
    Svenne Krap
    Nov 8, 2003
  3. Replies:
    2
    Views:
    544
  4. Gergely Kontra
    Replies:
    2
    Views:
    271
    Joao Pedrosa
    Jun 18, 2004
  5. Alex Shulgin
    Replies:
    1
    Views:
    194
    thefed
    Nov 21, 2007
Loading...

Share This Page