Re: Is it possible to force a tooltip to be shown.



В Ср, 02/10/2019 в 11:57 +0100, Carlos Gomez пишет:
Hi all,


I have a DrawingArea where I am plotting some data (lines made of
pairs 
of time/temperature) . When I click on a line or close enough I want
to 
show a tooltip indicating the line and the values. I can get the line
id 
and the values and I am updating the contents of the tooltip and
calling 
trigger_tooltip_query, but the tooltip is not shown until I move the 
mouse and wait for a little. Is there a way to force the tooltip to
be 
shown?


If I remove the call to trigger_tooltip_query the behaviour is
exactly 
the same: the tooltip is not shown if the mouse is not moved.

Thanks in advance.

Carlos.

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Hi there,

Look at my function that shows tooltip for treeview column (gtkmm-2.12
version)

    bool Grid::motion_notify_cb( GdkEventMotion* event )
    {
        Gtk::TreeModel::Path path;
        Gtk::TreeViewColumn* column;
        int cell_x, cell_y;

        if ( view.get_path_at_pos( (int)event->x,
                                   (int)event->y,
                                   path, column,
                                   cell_x, cell_y ) )
        {
            Glib::ustring tip = get_cell_tooltip( path, column->get_title() );
            if( !tip.empty() )
            {
                instanceProperties.tooltips->set_tip( view, tip );
                GdkEventCrossing* user_event = (GdkEventCrossing*)gdk_event_new( GDK_ENTER_NOTIFY );
                user_event->window = event->window;
                user_event->send_event = TRUE;
                user_event->subwindow = event->window;
                user_event->time = event->time;
                user_event->x = event->x;
                user_event->y = event->y;
                user_event->x_root = event->x_root;
                user_event->y_root = event->y_root;
                user_event->mode = GDK_CROSSING_NORMAL;
                user_event->detail = GDK_NOTIFY_ANCESTOR;
                user_event->focus = TRUE;
                Gdk::Event cpp_event( (GdkEvent*)user_event );
                cpp_event.put();
            }
            else
            {
                instanceProperties.tooltips->unset_tip( view );
            }
        }
        else
        {
            instanceProperties.tooltips->unset_tip( view );
        }
        return false;
    }

In other words you should fire event that will show tooltip at runtime
(emulate mouse entering area of tooltip widget)

Regargs,
-Andrew




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