Expanders and non-label headers



Hi all,

I'd like to use an expander to hide/show details for some emails that are to be processed as reports. A small amount of these details should be visible at all times (along with a few command buttons and a checkbox), and I was going to replace the label of the expander with a table containing the need-to-see information and the command buttons and checkbox, but I've hit a snag - widgets that replace the expander label lose their default actions and cause the expander to open/shut when they're clicked. Eg (using only a checkbutton):

use Gtk2 -init;
$mw = Gtk2::Window->new;
$ex = Gtk2::Expander->new(undef);
$mw->add($ex);
$cb = Gtk2::CheckButton->new("TEST");
$ex->set_label_widget($cb);
$lb = Gtk2::Label->new("BOO!");
$ex->add($lb);
$mw->signal_connect("delete_event", sub {exit});
$mw->show_all;
Gtk2->main;

As you can see, unless you're _very_ careful where you put the mouse, clicking on the checkbutton triggers the expander, not the checkbutton.

Is there something I can do to change this (that I can apply to various widgets, not just checkbuttons) so that my expander 'header' is something more useful than a simple label?

TIA,

MB


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