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

Re: image layout questions



On Tue, 2007-08-07 at 19:03 +1200, Johan Aberg wrote:
> Hello!
> 
> I've been trying gtk2 perl for a few days now. Coming from Tk I'm
> slowly learning how to code it.
> 
> I have a few questions, hope some of you could point me in the right direction.
> 
> 
> I'm looking for a way to display images in a horizontal layout. I'm
> building a timeline displaying images from left to right. I'd like to
> be able to use set_reorderable(TRUE) to shuffle the images around left
> or right on this timeline.
> The TreeView seems to be a good candidate of doing this, but it seems
> to be design to show data in rows and columns in a vertical layout. I
> only want one row with lots of columns and I need to be able to access
> each cell to reorder them.
> Any suggestion what widget/class that could help me out here?

a Gtk2::HBox in a scrolled window (added with ->add_with_viewport)
should do the trick. a Gtk2::TreeView is a widget designed for many rows
and very few columns, as you've guessed.

> Another part of the gui is a grid layout of images, rows and columns.
> Each cell containing an image that can be selected for various
> callbacks.
> I've build a simple prototype with IconView that works great. I can
> access individual images, drag n drop them, shuffle them around
> (reorderable), however, I can't figure out how to make the size of the
> icons bigger than 'dialog'. I would like to show images bigger than
> this, say 100x200 pixels big. I understand IconView is designed to
> display small icons, but since it seem to have all functionality I'm
> looking for I was hoping I could use it.

you don't want the IconView, in this case. as you can have by now
realised, forcing Gtk2 widgets to do what they are not designed for
usually ends up in huge kludges or a poorly performing application. :-)

there are no image viewing widgets readily available - the task is
pretty specific and too application-dependant. you will probably have to
write your own widget. there's a very small C library providing a widget
for displaying images called GtkImageView, which is not part of GTK+ and
has no bindings for Perl; writing bindings might very well take half an
hour and you could integrate it into your application.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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