Re: Question on gtk_label_set_selectable



On Sat, 2007-10-20 at 10:11 +0100, Chris Vine wrote:
On Fri, 2007-10-19 at 16:54 +0200, Gian Mario Tagliaretti wrote:
2007/10/19, David NeÄas (Yeti) <yeti physics muni cz>:
On Fri, Oct 19, 2007 at 03:06:55PM +0200, Gian Mario Tagliaretti wrote:

You can also set the can-focus property to FALSE on the label which
will be still selectable.

Not exactly.  It will be only selectable *with mouse*.

Good point David, I didn't think of that.

GtkEntry has a gtk-entry-select-on-focus property to deal with this.
Probably GtkLabel should have a similar property - it might be worth
submitting a bug/feature report.

Actually, on looking it up, I see that there is this property
available, via the GtkSettings object - see gtk-label-select-on-focus
at http://library.gnome.org/devel/gtk/unstable/GtkSettings.html .

The following should do the trick, if the behaviour is wanted on an
application wide basis:

GtkSettings* settings = gtk_settings_get_default();
if (settings) {
  g_object_set(settings,
               "gtk-label-select-on-focus", FALSE,
               NULL);
}

Chris





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