Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi monkies ;-)

I'm building a tool which will allow me to modify/set EXIF information for images (and prolly more in the future). This is my very first Gtk2 application. I've found the gtk-perl tutorial and I also know where to look up the API.

The subject is somewhat misleading: I *do* know how to create thumbnails et al., my problem is: my application freezes when I'm generating the thumbs, and of course, when all thumbs are generated, *pling* the application is back. How can I avoid this, and maybe use a Gtk2::ProgressBar to indicate that thumbs are being generated.
Or even better: how can update/redraw my application to show thumbs when they're being generated? So that you seem them appearing one at a time.

Ideas, hints, ... everything will be appreciated ;-)

Thanks!!

ugly try-out code for displaying the thumbs
for my $image (@images) { last if $total_count++ == 55; if(not $count){ $thumb_line = Gtk2::HBox->new(FALSE,1); $thumb_page->pack_start($thumb_line,FALSE,FALSE,5); } print "Thumbing ". $image->name."\n"; my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file ($image->name); my ($width,$height) = ($pixbuf->get_width, $pixbuf->get_height +); my ($scale_width,$scale_height) = $width > $height ? (80,70) : + (70,80); my $new_pixbuf = $pixbuf->scale_simple($scale_width,$scale_hei +ght,'GDK_INTERP_BILINEAR'); my $event_box = Gtk2::EventBox->new; $thumb_line->add($event_box); $event_box->show; my $image_widget = Gtk2::Image->new(); $image_widget->set_from_pixbuf($new_pixbuf); $image_widget->set_size_request(80,80); $image_widget->show; $event_box->add($image_widget); $event_box->signal_connect('button_press_event',\&image_clicke +d_event, $image->name); $event_box->window->set_cursor(Gtk2::Gdk::Cursor->new('hand1') +); $thumb_line->show; #$pbar->pulse(); #$pbar->show; $count = 0 unless ++$count < 10; $window->show; }

to ask a question is a moment of shame
to remain ignorant is a lifelong shame


In reply to Gtk2-perl: Create thumbnail pages by insaniac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-19 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found