Menu Item Factory



Ciao,

I have some problems with using of menus created by the Gtk Item Factory.

There is a small part of my developing code:

...
    { "/_Settings/_Binning", "<control>B", NULL, 0, "<Branch>" },
    { "/_Settings/_Binning/_3x3", "<control>3", set_bin, 3, "<RadioItem>" },
    { "/_Settings/_Binning/_2x2", "<control>2", set_bin, 2, "/Settings/Binning/3x3" },
    { "/_Settings/_Binning/_1x1", "<control>1", set_bin, 1, "/Settings/Binning/3x3" },
...
    { "/_Settings/", NULL, NULL, 0, "<Separator>"},
    { "/_Settings/Enable _Legend", "<control>L", set_legend, 0, "<ToggleItem>" },
    { "/_Settings/_Reuse Darks", "<control>R", set_darks, 0, "<ToggleItem>" },
...

The meaning of these items is not important. I don't know: 

1) how initialize radio item group to (for example) 2x2 item. The toggled 
   item by this way is 3x3 but I can't initialize some arbitrary item.

2) how set on the "Enable Legend" toggle button during init phase. I was
   tried the gtk_item_factory_get_widget/item function to get a toggle button
   from a item factory but without any success.

3) why, the choosing of argument 1x1 make 3x calls of set_bin with arguments 
   3,2,1? The set_bin is a void function, is it correct? 


Is it possible use the item factory by this way? I can rewrite code
to use no item factory, but I prefers use of its because the code
is significantly simpler.

Thank for any suggestions

FH 




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