Scrollable image widget

View: New views
4 Messages — Rating Filter:   Alert me  

Scrollable image widget

by foobar31415 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello list,

I want to have an image scrollable (if it exceeds the given space). So I
tried to put a GtkScrolledWindow around my GtkImage, but this doesn't
work. When running the application I get:

gtk_scrolled_window_add(): cannot add non scrollable widget use
gtk_scrolled_window_add_with_viewport() instead

What do I do?

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

Re: Scrollable image widget

by Sayamindu Dasgupta-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

On Fri, Jul 3, 2009 at 8:50 PM, Johannes Bauer<dfnsonfsduifb@...> wrote:

> Hello list,
>
> I want to have an image scrollable (if it exceeds the given space). So I
> tried to put a GtkScrolledWindow around my GtkImage, but this doesn't
> work. When running the application I get:
>
> gtk_scrolled_window_add(): cannot add non scrollable widget use
> gtk_scrolled_window_add_with_viewport() instead
>
> What do I do?
>

You can add your widget to a gtk.Viewport
(http://www.pygtk.org/docs/pygtk/class-gtkviewport.html) and then put
that inside a scrolledwindow.
Also, if you are looking for a somewhat more advanced imageviewer
widget - you can take a look at http://trac.bjourne.webfactional.com/

Thanks,
Sayamindu



--
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: Scrollable image widget

by foobar31415 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sayamindu Dasgupta schrieb:

>> What do I do?
>>
> You can add your widget to a gtk.Viewport
> (http://www.pygtk.org/docs/pygtk/class-gtkviewport.html) and then put
> that inside a scrolledwindow.

I also tried that (Scrolledwindow contains Viewport, Viewport contains
Image). Also did make the scrollbars always appear - but no matter how
large the image is, the scroll bars are always insensitive (greyed out)
and the image is simply cut off.

> Also, if you are looking for a somewhat more advanced imageviewer
> widget - you can take a look at http://trac.bjourne.webfactional.com/

I'll have a look into that, thanks.

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

Re: Scrollable image widget

by ilius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do you use "auto scrollbar policy" for ScrolledWindow?
swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

On 7/3/09, Johannes Bauer <dfnsonfsduifb@...> wrote:

> Sayamindu Dasgupta schrieb:
>
>>> What do I do?
>>>
>> You can add your widget to a gtk.Viewport
>> (http://www.pygtk.org/docs/pygtk/class-gtkviewport.html) and then put
>> that inside a scrolledwindow.
>
> I also tried that (Scrolledwindow contains Viewport, Viewport contains
> Image). Also did make the scrollbars always appear - but no matter how
> large the image is, the scroll bars are always insensitive (greyed out)
> and the image is simply cut off.
>
>> Also, if you are looking for a somewhat more advanced imageviewer
>> widget - you can take a look at http://trac.bjourne.webfactional.com/
>
> I'll have a look into that, thanks.
>
> Kind regards,
> Joe
> _______________________________________________
> pygtk mailing list   pygtk@...
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/