Re: keyboard short cuts/accelerators

2009-03-07 Thread Grizzly(Francis Smit)
Grizzly(Francis Smit) wrote: José Alburquerque wrote: On Fri, 2009-03-06 at 19:16 -0500, José Alburquerque wrote: On Fri, 2009-03-06 at 07:25 +1100, Grizzly(Francis Smit) wrote: Hi how do I do custom keyboard short cuts on my menu Items in Gtkmm ?? I'm using

Re: The use of RefPtr

2009-03-07 Thread Jonathon Jongsma
Eddie Carle wrote: On Sat, 2009-03-07 at 02:14 -0500, Hubert Figuiere wrote: Why do you think there is a Glib::RefPtrTreeModel ? It is not just for the show. It will unref when the Glib::RefPtr is destroyed, therefor when you leave the scope. I understand what RefPtr does. It is just like any

Re: The use of RefPtr

2009-03-07 Thread Murray Cumming
Eddie, presumably you are implementing a custom model (which will be difficult enough already), to avoid duplicating a large block of data inside the regular ListStore or TreeStore. And presumably it's this block of data that you don't want to allocate dynamically. Can't you just do that and use

Re: The use of RefPtr

2009-03-07 Thread Eddie Carle
On Sat, 2009-03-07 at 18:48 +0100, Murray Cumming wrote: Eddie, presumably you are implementing a custom model (which will be difficult enough already), to avoid duplicating a large block of data inside the regular ListStore or TreeStore. And presumably it's this block of data that you don't

Re: The use of RefPtr

2009-03-07 Thread Chris Vine
On Sat, 07 Mar 2009 12:30:23 -0700 Eddie Carle ed...@erctech.org wrote: On Sat, 2009-03-07 at 18:48 +0100, Murray Cumming wrote: Eddie, presumably you are implementing a custom model (which will be difficult enough already), to avoid duplicating a large block of data inside the regular

Re: The use of RefPtr

2009-03-07 Thread Eddie Carle
On Sat, 2009-03-07 at 20:24 +, Chris Vine wrote: I wonder if you are looking at this from the wrong direction. If you have a custom tree model which just references data allocated and held elsewhere (it does not make a deep copy), then why is limiting the tree model to local scope

Re: The use of RefPtr

2009-03-07 Thread Chris Vine
On Sat, 07 Mar 2009 13:49:48 -0700 Eddie Carle ed...@erctech.org wrote: [snip] In answer to your question, if you do not allow the tree model's reference count to reach zero then you will have a memory leak. But the point you may be missing here is that the tree view also acquires a

Re: The use of RefPtr

2009-03-07 Thread Eddie Carle
On Sat, 2009-03-07 at 21:52 +, Chris Vine wrote: I cannot comment on your other points because I do not have a clear enough view of how you are organizing your program, and in particular why having a tree model on the stack is such an issue for you if you are not doing a deep copy of the

Re: keyboard short cuts/accelerators

2009-03-07 Thread José Alburquerque
On Sat, 2009-03-07 at 16:28 +1100, Grizzly(Francis Smit) wrote: Grizzly(Francis Smit) wrote: José Alburquerque wrote: Ummm could you tell me more set_accel_key(const AccelKey accel_key) looks the best but it's protected, should I derive and use this?? set_accel_path(const

Re: The use of RefPtr

2009-03-07 Thread Chris Vine
On Sat, 07 Mar 2009 16:32:18 -0700 Eddie Carle ed...@erctech.org wrote: [snip] Now I see where the memory leak comes from. I was just examining the objectbase.h file in glibmm. This raises an interesting question as to why these functions are virtual. Were they made virtual to allow for

Re: The use of RefPtr

2009-03-07 Thread Chris Vine
On Sun, 8 Mar 2009 00:55:21 + Chris Vine ch...@cvine.freeserve.co.uk wrote: [snip] It would not be impossible (Gtk::Object enables it) to create the Glib::Object wrapper (but only the wrapper) on the stack, but it is ill-advised in a custom pure Glib::Object because it requires you to

Re: keyboard short cuts/accelerators

2009-03-07 Thread José Alburquerque
On Sat, 2009-03-07 at 19:49 -0500, José Alburquerque wrote: On Sat, 2009-03-07 at 16:28 +1100, Grizzly(Francis Smit) wrote: but how do I get the little label telling me what the accel is next to the item i.e. the Crtl+C Ctrl+D or whatever. I have tried add_accel_label(const

Re: keyboard short cuts/accelerators

2009-03-07 Thread José Alburquerque
On Sat, 2009-03-07 at 23:41 -0500, José Alburquerque wrote: The following gtk+ documentation may also be useful: http://library.gnome.org/devel/gtk/2.13/GtkMenuItem.html#gtk-menu-item-set-accel-path http://library.gnome.org/devel/gtk/2.13/gtk-Accelerator-Maps.html#gtk-accel-map-add-entry One

Re: DND in TreeView

2009-03-07 Thread Deng Xiyue
Deng Xiyue manp...@gmail.com writes: Hi gtkmm maintainers: I'm having some problem on handling DND in a TreeView. I tried to handle DND with signals in Gtk::TreeModel: Gtk::TreeModel::signal_row_deleted() and Gtk::TreeModel::signal_row_inserted(). In most cases they work well, except on