Re: g_object_get, newbie



Stéphane Konstantaropoulos wrote:

Le lun 17/02/2003 à 14:44, Michal Adamczak a écrit :
hi,

i'am new to gtk

i want to populate treeview
when the code is inside create_app1 (created by glade) everything is fine

i tried to put the code outside but i guess i cannot get the pointer
correctly

doeas g_object_get_data find recursively?

g_object_get_data retrieves data by name. Data that has been put into
the object before.

Better use of glade is without all the Gtk GUI code, just use the xml
file. Much easier.

do something like this:

main(){
        GladeXML *xml;
        GtkWidget *widget;

        xml = glade_xml_new ("yourfile.glade", //need absolute path
                                "window", "your app");
                //name of the widget where to start in the xml
                //then name of your app
                //this creates your window with everything in it.
        g_assert(xml != NULL);

        //get widget
        widget = glade_xml_get_widget (xml,"treeview1");

        //do something with your widget...
}

much clearer according to me.

I'll second that motion. It also allows
you to adjust your interface without
recompiling your code.

--
   _ _ _
  / \ \ \
 / / \ \ \          (el greco)
 \/_ | S  \   Muy Mano,
  | \/    /         Muy Presa.
   \_  K /  http://users.aber.ac.uk/ssk01
      \  \

  ------------------------------------------------------------------------

   signature.ascName: signature.asc
                Type: application/pgp-signature



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