Re: TreeView tooltip use immediate control
On Sat, 2012-02-04 at 00:01 +0100, David Nečas wrote: > On Fri, Feb 03, 2012 at 11:36:13PM +0100, Stefan Salewski wrote: > > How can I immediately activate or deactivate tooltips for all TreeView > > widgets on user action, i.e. menu operation. > > You can enable/disable all tooltips using the "gtk-enable-tooltips" > GtkSettings property. > > But if you want to enable/disable them just for some specific of widgets > you have to handle it yourself. The easiest method is probably making > the widgets query your enable/disable setting in their "query-tooltip" > signal handlers – and then return TRUE or FALSE from the handlers. > > Yeti Sorry, I may need some more help... I was not able to suppress the tooltips by returning FALSE from the signal handler -- in my Ruby code. So I took the listview.c example from Andrew Krauses book, added tooltip support. That works. Then I added a query-tooltip" signal handler returning FALSE -- but tooltips are further shown. The handler is called, I checked it with a printf statement inside the handler. The C code is here: http://www.ssalewski.de/tmp/liststore.c I used this function to add tooltips http://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-set-tooltip-column My current guess is, that it is not possible to suppress tooltips for a treeview by a "query-tooltip" signal handler. Maybe the handler is called after the tooltip is displayed, or called for each row/column of the treeview? But maybe I am doing something wrong, I have not much experience in C GTK programming. Best regards, Stefan Salewski ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: TreeView tooltip use immediate control
On Sat, 2012-02-04 at 00:01 +0100, David Nečas wrote: > On Fri, Feb 03, 2012 at 11:36:13PM +0100, Stefan Salewski wrote: > > How can I immediately activate or deactivate tooltips for all TreeView > > widgets on user action, i.e. menu operation. > > You can enable/disable all tooltips using the "gtk-enable-tooltips" > GtkSettings property. > I guess this works on all applications of the Gnome/GTK desktop? Maybe not what the user wants... > But if you want to enable/disable them just for some specific of widgets > you have to handle it yourself. The easiest method is probably making > the widgets query your enable/disable setting in their "query-tooltip" > signal handlers – and then return TRUE or FALSE from the handlers. > > Yeti Thanks, this sounds good. I was not aware that this "query-tooltip" handler is involved at all when I only use a simple gtk_tree_view_set_tooltip_column() (http://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-set-tooltip-column) I will test it. Best reagards, Stefan Salewski ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: TreeView tooltip use immediate control
On Fri, Feb 03, 2012 at 11:36:13PM +0100, Stefan Salewski wrote: > How can I immediately activate or deactivate tooltips for all TreeView > widgets on user action, i.e. menu operation. You can enable/disable all tooltips using the "gtk-enable-tooltips" GtkSettings property. But if you want to enable/disable them just for some specific of widgets you have to handle it yourself. The easiest method is probably making the widgets query your enable/disable setting in their "query-tooltip" signal handlers – and then return TRUE or FALSE from the handlers. Yeti ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
TreeView tooltip use immediate control
I have an application which use many TreeView widgets (see http://www.ssalewski.de/PetEd.html.en). I use set_tooltip_column() to activate tooltips at program start when widgets are created. How can I immediately activate or deactivate tooltips for all TreeView widgets on user action, i.e. menu operation. It should not be necessary to terminate and restart the program. Of course I can use a list of all TreeView widgets for accessing all and use set_tooltip_column()... But I guess I should solve this problem by using events? Which GTK event is best used for this modification? Or should I emit an event myself, when user wants to toggle tooltip display? I have no idea currently. Thanks, Stefan Salewski ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list