[Glade-devel] Menu editor stuff

Hi Juan,
        I added the push/pop group stuff to glade-command,
it works like a charm; I also have a working prototype of
glade-gtk.c except for one problem:

The reordering stuff doesn't work, undoing and redoing reorders
reverses the order all the time.

The solution that comes to mind is using "child-set-property-function"
on GtkMenu in order to implement a custom "position" packing property
for menu items (similar to the GtkBox position property), this property
would not be saved to the glade file so the backend would have to
assign it at load time.

All the actual reordering would be handled by the set-child-property
function provided for the "position" property, and when reorders are
needed, we'll just glade_command_set_property to get that done.

Then it should all go fine (fingers crossed).

I've attached here a patch against current cvs which shows my
working implementation of undo/redo on menu actions (but ofcourse
with reordering broken)... It also includes an example of how to
declare virtual packing properties (i.e. the position property).

I probably won't get any more work in tonight or tomorrow, so feel
free to hack away on this reorder issue, otherwise I'll get that
ironed out next time I get the chance (sometime next week).

A short todo list:
     o Signal editor & Remove button should be insensitive when
       no menuitems are selected in the tree.

     o Try to find a way to re-arange the UI to make space for
       Undo/Redo buttons (I think we should avoid accelerators)

     o Editor will have to handle the appropriate signals (see
       glade-project-view for examples) to update the treeview
       when the project is modified (i.e. added/removed/reordered
       items as a result of undo/redo)

     o We'll have to modify the glade-editor code (maybe some backend
       from glade-widget-class) so that any remote child of a widget
       who's class provides a "launch-editor-function" the "Edit..."
       button will show up for them too.

       We should also consider that a parent & child in a hierarchy may
       both have editor support, we should probably get the backend to
       provide a string for its "Edit..." button and let those buttons


-------------- next part --------------
A non-text attachment was scrubbed...
Name: glade.patch
Type: text/x-patch
Size: 8205 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-devel/attachments/20051217/dfb10b61/glade.bin

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