GtkImage Signals (looking for a mouse click)


Results 1 to 2 of 2

Thread: GtkImage Signals (looking for a mouse click)

Hybrid View

  1. #1
    Join Date
    May 2001
    Location
    Uh, I'm somewhere where I don't know where I am.
    Posts
    1,228

    GtkImage Signals (looking for a mouse click)

    How can I get a GtkImage * to emit a signal when someone hits the mouse button? Or, can I place the Image in a GtkFixed and get a mouse click on that? I can then find the location of the mouse and see if it's clicked on a card or not.

    Anyway, here's the layout of what I'm working on so far:

    if (i_forgot && this_is_about_code)
    language = c++;

  2. #2
    Join Date
    May 2001
    Location
    Uh, I'm somewhere where I don't know where I am.
    Posts
    1,228
    Just wrap an event box around it

    Code:
    myeventbox = gtk_event_box_new ();
        gtk_widget_show (myeventbox);
        gtk_container_add (GTK_CONTAINER (frame2), myeventbox);
        gtk_widget_add_events(myeventbox, GDK_BUTTON_RELEASE_MASK);
        gtk_widget_add_events(myeventbox, GDK_BUTTON_PRESS_MASK);
        gtk_widget_add_events(myeventbox, GDK_BUTTON1_MOTION_MASK);
    
        myimage = gtk_image_new_from_pixbuf(/*blah blah*/);
        gtk_widget_show (myimage);
        gtk_container_add (GTK_CONTAINER (myeventbox), myimage);
    Ok, done posting GTK+ Qs here, I finally got around to joining the GTK+ app mailing list. have a good day!
    if (i_forgot && this_is_about_code)
    language = c++;

Posting Permissions

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