Need your help when I writing my own gtk widgets



Hello all
     First of all,i apologize for my terriblly poor English!
     I am going to write a widget for my application
     In my application,there need a virtual instrument,some more like a
watch,but, in the bottom,there must have a digital display of its value
     In fact,what is I want is some more like the dial widget in the gtk
tutorial,but ,the dial widget in the gtk tutorial has no digital display on the
bottom.

     I want,split the widget in to two half parts in logic,top half and bottom
half
     The top half ,just like the dial widget in the gtk tutorial.
     The bottom half,use the GtkSpinButton widget.
     In other words,my widget will be a composite widget

    I want to know,is that possible ?
    and,how can I do that ?
    I am a newbie,totaly!
    Actually,i tried several times
    but the porblem is that,i didn't knowe how to handle the
"button_press_event"
    Because, if clicked on the dial part,the mouse should grab the dial's
pointer
    if clicked on the GtkSpinButton part,the correct thing should be increase
or decrease the current value

    But, I really don't know how to make the "button_press_event" function
differently when the mouse clicked the widget in different positions

    I also read the GtkCalender.h GtkCalender.c files  in the gtk distribution
    Because ,I think,the GtkCalender widget is more or less like this
    But,i am not understand these files
    
    I hope the source files comes with the gtk distribution have comments ,but
it is really not have comments

    Some advice?
    Any help would be much appreciated!
    MY Operation system is RedHat Linux Fedora Core 4
    MY gtk version is Gtk+-2.6.7
     


        

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



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