On Thu, 2008-10-23 at 15:42 +0200, Laszlo Nagy wrote:
> Gustavo J. A. M. Carneiro wrote:
> > http://www.daa.com.au/pipermail/pygtk/2006-January/011668.html
> >   
> Yes, this was the only related post that I could find on the internet. 
> But I could not use it for anything because it does not tell how to do 
> it. It says:
> 
> "For custom widgets, check the method 
> gtk.Widget.set_set_scroll_adjustments_signal(signal_name)"
> 
> 
> But this method only has a signal_name parameter. I do not see how I 
> could use it for specifying my adjustments and making my widget support 
> scrolling natively?
> 
> (Also that was written in 2006, probably it is outdated.)

It is not outdated.  See
http://library.gnome.org/devel/gtk/2.14/GtkWidget.html

        GtkWidgetClass
        typedef struct {
          /* The object class structure needs to be the first
           *  element in the widget class structure in order for
           *  the class mechanism to work correctly. This allows a
           *  GtkWidgetClass pointer to be cast to a GtkObjectClass
           *  pointer.
           */
          GtkObjectClass parent_class;
        
          
          guint activate_signal;
        
          guint set_scroll_adjustments_signal;
        } GtkWidgetClass;
        
        activate_signal The signal to emit when a widget of this class
        is activated, gtk_widget_activate() handles the emission.
        Implementation of this signal is optional. 
        
        set_scroll_adjustment_signal This signal is emitted when a
        widget of this class is added to a scrolling aware parent,
        gtk_widget_set_scroll_adjustments() handles the emission.
        Implementation of this signal is optional.
        
        
gtk.Widget.set_set_scroll_adjustments_signal is PyGtk's equivalent to
Gtk+/C setting the field set_scroll_adjustments_signal of the
GtkWidgetClass of your widget.  Basically you have to define a signal
"my-signal" in your widget that accepts two gtk.Adjustment objects as
parameters, then do
MyClass.set_set_scroll_adjustments_signal("my-signal").  Of course you
still need to implement the scrolling by monitoring the adjustments and
updating the widget's view accordingly, but after that you can add your
widget to a scrolled window.

        
> 
> Thanks,
> 
>    Laszlo
> 
> 
-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
"The universe is always one step beyond logic" -- Frank Herbert

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to