Re: gtk-bin.c error when using frames



    Dinesh>     // create source frame
    Dinesh>     frame = makeFrame();
    Dinesh>     gtk_container_add(GTK_CONTAINER(topLevelWindow), frame);

Try

    gtk_container_add(GTK_CONTAINER(frame), topLevelWindow);

instead...  Gtk is an object-oriented programming system implemented in C.
Methods are always functions that prefix the conceptual method (e.g. "add")
with the class for which the method is defined ("gtk_container" in this
case).  The first argument must always be an instance of the class and
corresponds to "this" in C++ or self in languages like Python or Smalltalk.
You can think of the above call as

    frame.add(topLevelWindow)

(In fact, if you where using PyGtk, that's exactly how you'd write it.)

-- 
Skip Montanaro (skip pobox com)
http://www.mojam.com/
http://www.musi-cal.com/




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