Re: how can I set up a passive Gtk::CheckButton with just a tooltip?



You could try just painting the check indicator using the style engine:

http://gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Style.html#e3b5d01cf574fa890832786eebf64f52
http://library.gnome.org/devel/gtk/2.10/GtkStyle.html#id2911903

It's maybe somewhat odd to use this directly from an application, but
not totally out of the normal (custom widget implementations might
just use this..)

HTH, Milosz

On 9/8/07, Christopher Lang <christopher lang acurana de> wrote:
>
> Folks,
>
> I am trying to use Gtk::CheckButton as a passive widget that just shows to the
> user if something is enabled, without letting the user activate and
> deactivate the checkbox.
>
> I tried a lot of things, like using set_events(...) etc, without success. I
> put the CheckButton into an EventBox and masked all Events, still, the user
> can check and uncheck the checkbox with the mouse and the checkbox lights up
> as soon as the mouse moves over it or over the label.
>
>         How can I set up a CheckButton, that is *not* greyed out, but apart from a
> tooltip is totaly passive?
> (set_sensitive (false) disables tooltips).
>
> Here is my current code with the EventBox:
>
>
> EventBox* sub2_eventbox = new EventBox();
> sub2_eventbox->set_events (Gdk::EventMask(0));
> sub2_eventbox->set_manage();
>
>         CheckButton* sub3_check1 = manage (new CheckButton ("<span
> size=\"small\">Roaming</span>"));
>         ((Label*)sub3_check1->get_child())->set_use_markup();
>         sub3_check1->set_active (false);
>         sub3_check1->unset_flags (CAN_FOCUS);
>         sub2_eventbox->add (*sub3_check1);
>
> sub1_vbox1->pack_end (*sub2_eventbox, PACK_SHRINK);
>
>
> Help is very much appreciated!
>
> thanks,
> Chris
>
>
> http://www.acurana.de/
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>



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