Confused about GtkFactory semantics.




I'm trying to get a handle on GtkSubfactories.  I examined the sample
code in the tutorial, and I looked over the source, but I still had a
few things I was confused about.

It is supposed to be 1 GtkFactory per menubar, or can you have one per
application, and store each menubar as a separate subfactory?  The
reason I ask is that you usually have definitions like this:

  <Main>/File/Open
  <Main>/File/Close
  <Main>/Edit/Select All...

etc.

This would imply that you might be able to do something like this to
specify multiple menubars for different windows:

  <Main>/File/Open
  <Main>/File/Close
  <Main>/Edit/Select All...
  <OtherWin>/File/Open
  <OtherWin>/File/Close
  <OtherWin>/Edit/Select All...

Looking at the code suggests that this won't actually work, but I
wasn't sure.  If it won't work, then what's the purpose of the leading
<Main> or whatever, since all of the menu items in a given factory
will share the same top level (i.e <Main>) string?

More generally, what's the real distinction between factories and
subfactories?  Is it that you have one subfactory per menu (i.e. a
cascaded menu has a subfactory for each level?  If so, does this mean
that you can't just add items like:

  <Whatever>/Foo/Bar/Baz/Bax

and expect all the sublevels to be created recursively?

Thanks, and please point me at the right place to RTFM if there is
one.

-- 
Rob Browning <rlb@cs.utexas.edu>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30



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