RE: Tooltips (or similar) on a drawing area?



Im not completely sure if it will work in this case, but you should be able
to do it similarly to how glade does it.  With glade they create a
GtkTooltips and set a tip for each object which is a child of the window,
eg:

        GtkWidget *mywindow = ...
        GtkWidget *mydrawingarea = ...

        GtkTooltips *mytooltips = gtk_tooltips_new();
        
        gtk_tooltips_set_tip(mytooltips,mydrawingarea,"this is a
tooltip",NULL);

        .
        .       /* set tips for other widgets here */
        .
        
        /* set to the GtkObject of the window */
        gtk_object_set_data(GTK_OBJECT(mywindow),"tooltips",tooltips);

I dont know if this helps; there is more information in this at:
http://developer.gnome.org/doc/API/gtk/gtktooltips.html

Regards, 

Martyn

-----Original Message-----
From: Juha Nieminen [mailto:warp cs tut fi]
Sent: Thursday, May 30, 2002 12:17 AM
To: gtk-app-devel-list gnome org
Subject: Tooltips (or similar) on a drawing area?



  In an application I have a drawing area (created with
gtk_drawing_area_new()) where I draw circles and arrows between
them (ie. a graph).

  I would like to have tooltips on the circles, that is, when 
the mouse
goes over a circle, the program would popup a tooltip containing text
related to that circle (it's ok if the area where the tooltip pops up
is a square instead).
  The text can have several lines, so the tooltip should be 
able to show
several lines of text, not just one.

  What would be the best and easiest way of achieving this?

  (I am using gtk 1.2, but 2.x-exclusive answers are also ok. I could
upgrade.)

                                                      - Juha


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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