How to make reference to widget from another file?



Hi,

I am using Glade 2.

Let's say my app got two buttons, one combo, one label, and one textentry.

When either of the button get clicked, the combo, label and textentry will
fill with hardcorded sentence.
The content of callbacks.c is as following:
    static void
    on_button1_clicked (GtkButton *button, GtkComboBox *combobox)
    {
      fillCombo ();
      setLabel();
      setEntry();
    }

    static void
    on_button2_clicked (GtkButton *button, GtkComboBox *combobox)
    {
      fillCombo ();
      setLabel();
      setEntry();
    }


I have some common function stored in another file, called utils.c. 
the functions of utils.c are

void      fillCombo ();
void      setLabel();
void      setEntry();

The problem here is, how do I make reference to widget from another file? I
got 5 files, main.c, interface.c, callbacks.c, support.c, and utils.c. The
widgets are created in interface.c. How to access the widgets from utils.c?

Thanks.

-- 
View this message in context: http://www.nabble.com/How-to-make-reference-to-widget-from-another-file--tf2505542.html#a6985746
Sent from the Gtk+ - General mailing list archive at Nabble.com.




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