Find the answer to your Linux question:
Results 1 to 3 of 3
Howdy all. I'm writing a program using Gtk, and I'm trying to get 2 things to happen simultaneously. My program traverses multiple images in a single directory, with the images ...
  1. #1
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230

    Gtk+ do 2 actions simultaneously

    Howdy all. I'm writing a program using Gtk, and I'm trying to get 2 things to happen simultaneously.

    My program traverses multiple images in a single directory, with the images inside of a Scrolled Window. When I change to a new image, I call this function:
    Code:
    void image_viewer_viewer_set_image(viewer *v, char *img_path)
    {
        GtkWidget *image = v->image;
    
        gtk_image_set_from_file(GTK_IMAGE(image), img_path);
        reset_scrollbars(v);
    }
    reset_scrollbars() moves the scrollbars back to the upper-left position. The problem is that these two actions do appear simultaneously: you see the image jump back to the upper-left and then change.

    I was wondering if there's any way to have both of these things appear simultaneously.
    DISTRO=Arch
    Registered Linux User #388732

  2. #2
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247
    Quote Originally Posted by Cabhan View Post
    Howdy all. I'm writing a program using Gtk, and I'm trying to get 2 things to happen simultaneously.

    My program traverses multiple images in a single directory, with the images inside of a Scrolled Window. When I change to a new image, I call this function:
    Code:
    void image_viewer_viewer_set_image(viewer *v, char *img_path)
    {
        GtkWidget *image = v->image;
    
        gtk_image_set_from_file(GTK_IMAGE(image), img_path);
        reset_scrollbars(v);
    }
    reset_scrollbars() moves the scrollbars back to the upper-left position. The problem is that these two actions do appear simultaneously: you see the image jump back to the upper-left and then change.

    I was wondering if there's any way to have both of these things appear simultaneously.
    sorry i understood like this..
    mean that just like online and offline(presence)??
    "Relationships are built on trust and communication"

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I'm not sure I understand what you mean by online and offline(presence).

    Also, I made a typo in my post: the actions currently do NOT happen simultaneously.

    I think that this would involve some form of double-buffering: write both changes to the offscreen copy, and then replace the onscreen version. Unfortunately, I have no idea how to do that.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...