help with image swap example



What would be the "best" way to code a GTK2 app to read in the
filenames of some .jpg images from a hard coded directory path,
display those filenames in a list, default to displaying the first
image, and display the name in a label below the image. I would like
to have it where clicking on another filename in the list would update
both the image and its label with that newly selected file.

I am new to GTK and am totally new to writing code which deals with
images, so please excuse my ignorance! I have worked my way through
the GTK2 tutorial but am currently stumped with several concepts, so I
have combined these areas of confusion into this single concept
example.

I am currently trying to implement the above example using:
a listbox (I'm trying to use GtkTreeView + gtk_list_store_append)
an image (I'm trying to use GTK_TYPE_IMAGE),
and a label (GtkLabel.... although Pango seems like vast overkill)
maybe a "quit" button for a graceful exit

What is the "best" way to dynamically update the image and label? Is
there a secret to making the listbox work without mountains of code?
(ie, am I on the right track with GtkListStore+GtkTreeView?) These are
all areas that have me stumped at the moment as I'm trying to move
beyond the initial tutorials. Perhaps there is some additional sample
code I should look at too see how this could be implemented? I am
interested in seeing how this could "best" be done, not my current
broken mess.

Thank you for the help and for your collective patience for a beginner like me,
Dave H.



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