Hekp,writing my own widget,about gtk_widget_new



Hello all
    I am frastrated about writing my own gtk widget

    You know,in the gtk tutorial, there is a widget named gtkdial
    And its definition like this :
----------------------------------------------
gtkdial.h
    struct _GtkDial
    {
         GtkWidget widget;
         ...
     }
-------------------------------------------------
    I want make my own widget as composite widget
    but i not wante make a "gtkdial" widget first ,
    then composite "gtkdial" and "GtkSpinButton".

    So i have an idea as follow
     make my own widget partly based on GtkWidget,and partly use GtkSpinButton
   so my widget's definition may be someting like this :
   -------------------------------------------------------
   mygtkdial.h
   struct _myGtkDial
   {
          GtkTable table;
          GtkWidget *widget;
          GtkWidget *spin_button;
    }
  
   Obviously, i use GtkTable as parent
  
    But the problem is :I cannot create a GtkWidget widget 
   
    I want to Knowe:whether my idea  is possible or not ?
    
    Must I create "mygtkdial" widget first ,then composite it with
GtkSpinButton?
    (this means i must write two user-difined widget)

    Both my gtk programming technic and English need your advice and
corrections
Thanks in advance
Any help woulb be much appreciated!


        

        
                
___________________________________________________________ 
雅虎1G免费邮箱百分百防垃圾信 
http://cn.mail.yahoo.com/



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