Creating widget from scratch




I am a novice Gtk programmer and have taken on the creation of a new
widget (a ledger-type widget for use in an accounting package) as a
learning exercise.  I have followed the "Writing Your Own Widgets" section
in the GTK Tutorial as well as looked at the source code to other widgets
and am still having a small problem: Whenever I create my widget
(GtkLedger), I get a "** WARNING **: invalid cast from "(unknown)" to
"GtkWidget" message when the application is started.

To me, it would appear that my new widget type has not been registered,
but I have stepped through the code of "gtk_ledger_get_type()" (copied
from the GTK Tutorial and modified for my widget) to ensure it returns a
proper return code.  And this code is being called from
"gtk_ledger_new()", so I know it's being executed.

Does anybody have any idea as to what I may have overlooked?

Much thanks.

Mike.

======================================================================
  Mike Frisch                         Email: mfrisch@saturn.tlug.org
  Northstar Technologies        WWW: http://saturn.tlug.org/~mfrisch
  Newmarket, Ontario, CANADA
======================================================================



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