y.
-Original Message-
*Date*: Mon, 23 Dec 2019 13:23:20 +0100
*Subject*: Re: custom TreeModel
*Cc*: gtkmm-list@gnome.org <mailto:gtkmm-list@gnome.org>
*To*: danny <mailto:danny%20%3cdanny.van.el...@skynet.be%3e>>
*From*: Kjell Ahlstedt <mailto:kjell%20ahlstedt%20%3ckj
hi,
on one hand I genuinely feel that there is a real use case for this:
imagine a library that you've written, and you want to show its results
in a gtk treeview, but straight from your result data structure and not
by duplicating the nodes in the treeview itself. What if the input-
output schema
An alternative would be to add this in a new
gtkmm-documentation/examples/book/custom/custom_treemodel directory in
the gtkmm tutorial. And a description in a new section in the /Custom
Widgets/ chapter (which should then be renamed).
Isn't this kind of custom class that implements one or more
hello gtkmm,
so how do I continue with this? I feel that it would be really handy to
add an example such as the one below to the gtkmm demos subdir.
I was struggling with this myself some years ago for a gtk2 program
where the data were already established (and constantly changing)
outside the gui
hi
well, actually, I did not find the example you are referring to. I
probably did when I was working with the original gtk2 program, though.
so I have come up with this:(gtkmm-3.22.3/demos)
--/* Tree
View/Tree Store * * The GtkTreeStore i
Your custom TreeModel can perhaps be added either to the gtkmm demo
programs or to the gtkmm tutorial at
https://gitlab.gnome.org/GNOME/gtkmm-documentation. Let's decide when
you have a working program.
Have you noticed that there is a custom TreeModel example at
https://gitlab.gnome.org/GNOM
indeed! that seems to get me on my way! thanks!
if/when I get this working: would you be interested in adding this to
the gtkmm demo programs?
regards, D.
*
From: Kjell Ahlstedt
Have you declared your custom TreeModel something like
class MyTreeModel : public Glib::O
well, I was trying to come up with a good demo, because I have always
felt that people will like to fill a treeview directly from their own
data
it has been a while since I have worked woth gtkmm, so I adapted the
following from a working program against gtk-2:
the Gtk::Window* do_treeview_memor
Have you declared your custom TreeModel something like
class MyTreeModel : public Glib::Object, public Gtk::TreeModel
That's wrong. Glib::Object must be declared after the base interface(s):
class MyTreeModel : public Gtk::TreeModel, public Glib::Object
This restriction was introduced about 5
please show the rest of the class declaration, including what/how it
inherits, and how you instantiate it.
___
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Sorry for the noise.
1) is for the Treeview to access the treemodel
2) is for the treemodel to access the data
eric jrdn2 wrote:
> Hi all,
> i'm building a treeview on a custom treemodel based on std::vector.
> My wish is to build it without knowing the number and the type of the
> treecolumns at
On 5/23/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
I reused your tarball after adjusting configure.in so
configure can work with my version of gtkmm. It
compiled well and worked well. I then removed virtual
inheritance. This time it gave me the same runtime
warnings you mentioned. However my own
--- Jonathon Jongsma <[EMAIL PROTECTED]>
wrote:
> actually, I believe most of the warnings I was
> talking about were
> run-time warnings, not compiler warnings. I hadn't
> really noticed any
> compiler warnings -- maybe there were some and I
> missed them though.
> I was able to compile just fin
On 5/23/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
Hi Jonathon
I have downloaded your tarball and gave it a trial.
First of all it does do the trick. It is way simpler
to inherit from your class than to inherit from
(implement) TreeModel directly.
I see that you got rid of the GlueItem used in
--- Jonathon Jongsma <[EMAIL PROTECTED]>
wrote:
> In any case, i put
> a tarball up
> here:
>
http://download.gna.org/colorscheme/etc/customtreemodel-0.0.1.tar.gz
>
> If you get a chance to look at it that'd be great.
>
> Thanks,
> Jonner
>
Hi Jonathon
I have downloaded your tarball and gav
On 5/23/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
> On 5/20/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
> [ a bunch of interesting ideas about implementing a generic custom
> TreeModel]
>
>
> Thanks a lot for your input Tamer. You've given me a lot of good
> ideas. I'll try to experiment w
> On 5/20/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
> [ a bunch of interesting ideas about implementing a generic custom
> TreeModel]
>
>
> Thanks a lot for your input Tamer. You've given me a lot of good
> ideas. I'll try to experiment with some of them and report back when
> I've got somethi
On 5/20/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
[ a bunch of interesting ideas about implementing a generic custom TreeModel]
Thanks a lot for your input Tamer. You've given me a lot of good
ideas. I'll try to experiment with some of them and report back when
I've got something for people
--- Jonathon Jongsma <[EMAIL PROTECTED]>
wrote:
> On 5/19/06, Tamer Mowafy [EMAIL PROTECTED] wrote:
> > Second you may consider declaring your template
> > parameters like this:
> >
> > template < class T, template < class U, class =
> > allocator > class TContainer>
> >
> > this makes your class
On 5/19/06, Tamer Mowafy <[EMAIL PROTECTED]> wrote:
first if the basic idea was to keep only one copy of
data around, you may think of using a reference to the
wrapped container.
>private:
> T m_container;
can be:
T& m_container;
this will allow two-way updates to be automatically
sensed on bot
Jonathon
I have enjoyed following the discussion about
introducing a generic TreeModel class. Using a
template class is a great idea for it sure would make
it easy to initialize the class with STL containers. I
have some few notes
first if the basic idea was to keep only one copy of
data around,
On Fri, 2006-05-19 at 13:40 -0500, Jonathon Jongsma wrote:
> So if I understand correctly, you have a ListModel and an underlying
> data container.The ListModel has the same number of elements as your
> underlying data store, but contains shared_ptrs to the elements of
> your data store instead of
On 5/19/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
On Fri, 2006-05-19 at 12:05 -0400, Paul Davis wrote:
> libardour is the backend to multiple UIs (not all of them graphical). it
> is not allowed to have a dependency on the code used by any particular
> UI implementation. i.e. its not OK for t
On Fri, 2006-05-19 at 12:05 -0400, Paul Davis wrote:
> libardour is the backend to multiple UIs (not all of them graphical). it
> is not allowed to have a dependency on the code used by any particular
> UI implementation. i.e. its not OK for the curses implementation to have
> to link against GTK,
On Fri, 2006-05-19 at 17:59 +0200, Murray Cumming wrote:
> On Fri, 2006-05-19 at 10:41 -0400, Paul Davis wrote:
> > the one thing that is a little unfortunate about a custom treemodel
> > based on Gtk/Glib objects is that if you are strict about
> > Model/View/Controller programming to the extent t
On Fri, 2006-05-19 at 10:41 -0400, Paul Davis wrote:
> the one thing that is a little unfortunate about a custom treemodel
> based on Gtk/Glib objects is that if you are strict about
> Model/View/Controller programming to the extent that you do not allow
> your Model implementation to use View-rela
On 5/19/06, Paul Davis <[EMAIL PROTECTED]> wrote:
the one thing that is a little unfortunate about a custom treemodel
based on Gtk/Glib objects is that if you are strict about
Model/View/Controller programming to the extent that you do not allow
your Model implementation to use View-related code
On 5/19/06, Andrew E. Makeev <[EMAIL PROTECTED]> wrote:
That is may way of creating custom models:
class CommonModel // class with common data handling and sorting
methods for my data-container
{...}
class DataListTreeModel
: public Glib::Object
, public Gtk::TreeModel
On 5/19/06, Paul Davis <[EMAIL PROTECTED]> wrote:
I agree with this whole heartedly. If we start making assumptions about
what gets passed to this class, it starts to lose some of its use.
Unless theres a very very good cause for doing so I'd recommend making
any assumptions.
I assume you mean
Jonathon Jongsma wrote:
> In fact i have a skeleton like this implemented to play around with,
> but I can't get it to instantiate. When I call the
> MyListModel::create() function, I keep getting errors like this:
>
> glibmm-CRITICAL **: Glib::Interface::Interface(const
> Glib::Interface_Class
Jonathon Jongsma wrote:
Why would he need to derive a class? Wouldn't the templated class be
enough?
Well, the CustomTreeModel class can implement a lot of the virtual
functions (i.e. iter_next_vfunc, things like that), but it can't very
easily implement anything related to values that are
the one thing that is a little unfortunate about a custom treemodel
based on Gtk/Glib objects is that if you are strict about
Model/View/Controller programming to the extent that you do not allow
your Model implementation to use View-related code (e.g GTK), its not
possible to use the treemodel for
> So it seems that when I use virtual inheritance, the warnings go away.
Avoid introducing any new virtual inheritance. If the example doesn't do
it then you don't need to do it.
Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
www.openismus.com
___
gt
On 5/19/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
>> > I don't have a lot of experience with GObject stuff, so I have no idea
>> > whether these should be necessary or not. But it seems to run fine
>> > and doesn't issue a warning when those lines are commented out. Any
>> > thoughts?
>>
>>
>> > I don't have a lot of experience with GObject stuff, so I have no idea
>> > whether these should be necessary or not. But it seems to run fine
>> > and doesn't issue a warning when those lines are commented out. Any
>> > thoughts?
>>
>> Yes, I think I comment them out in Glom too.
>
> OK. T
On 5/19/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
On Thu, 2006-05-18 at 18:55 -0500, Jonathon Jongsma wrote:
> OK, I think I get it now, more or less. I've just noticed, however
> that when I run the example from gtkmm CVS, I get the following
> warning:
>
> (lt-example:29959): GLib-GObject-
On Thu, 2006-05-18 at 18:55 -0500, Jonathon Jongsma wrote:
> OK, I think I get it now, more or less. I've just noticed, however
> that when I run the example from gtkmm CVS, I get the following
> warning:
>
> (lt-example:29959): GLib-GObject-WARNING **: cannot add interface type
> `GtkTreeModel'
On 5/17/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
It's all to do with the fact that you don't have much control over when
the per-iter data is deallocated. You just get to say "everything I have
allocated before now is now invalid, so I'll release it and it's your own
dam fault if you try to
> On 5/17/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
>> Maybe you should just store the Palette in the list model and use
>> cell_data_func callbacks to show it in the treeview.
>
> Hmm, that's an interesting idea. I'll look into that.
>
>>
>> I've done it in Glom, but the gtkmm example is sim
On 5/17/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
Maybe you should just store the Palette in the list model and use
cell_data_func callbacks to show it in the treeview.
Hmm, that's an interesting idea. I'll look into that.
I've done it in Glom, but the gtkmm example is simpler.
I assu
On 5/17/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
>> > even cooler if it actually derived from some STL abstract type,
>>
>> What kind of type do you mean exactly? Standard C++ containers are not
>> meant to be used as base classes. They do conform to standard
>> types/requirements, but I thi
>> > even cooler if it actually derived from some STL abstract type,
>>
>> What kind of type do you mean exactly? Standard C++ containers are not
>> meant to be used as base classes. They do conform to standard
>> types/requirements, but I think those are just concepts rather than
>> actual
>> clas
On Wed, 2006-05-17 at 14:06 +0200, Murray Cumming wrote:
> > On Wed, 2006-05-17 at 09:49 +0200, Murray Cumming wrote:
> >> [snip]
> >> > Actually, I wonder if it is possible that gtkmm provide custom model
> >> > implementation. Developer should just provide data container class
> >> > derived from
On 5/17/06, Murray Cumming <[EMAIL PROTECTED]> wrote:
[snip]
> Actually, I wonder if it is possible that gtkmm provide custom model
> implementation. Developer should just provide data container class
> derived from some Gtk::virtual-base class and reimplement methods to
> get/set data from/to yo
> On Wed, 2006-05-17 at 09:49 +0200, Murray Cumming wrote:
>> [snip]
>> > Actually, I wonder if it is possible that gtkmm provide custom model
>> > implementation. Developer should just provide data container class
>> > derived from some Gtk::virtual-base class and reimplement methods to
>> > get/
On Wed, 2006-05-17 at 09:49 +0200, Murray Cumming wrote:
> [snip]
> > Actually, I wonder if it is possible that gtkmm provide custom model
> > implementation. Developer should just provide data container class
> > derived from some Gtk::virtual-base class and reimplement methods to
> > get/set data
[snip]
> Actually, I wonder if it is possible that gtkmm provide custom model
> implementation. Developer should just provide data container class
> derived from some Gtk::virtual-base class and reimplement methods to
> get/set data from/to your container by given Gtk::TreeModelPath or
> Gtk::TreeI
Murray Cumming wrote:
After poking around a bit in my freshly built gtkmm, I noticed this:
gtkmm/examples/Makefile.am
# Doesn't build with GLIBMM_ENABLE_PROPERTIES unset:
#cellrenderercustom
Dunno if thats important or not though.
That's a different example.
There's a note in the Chang
> After poking around a bit in my freshly built gtkmm, I noticed this:
>
> gtkmm/examples/Makefile.am
> # Doesn't build with GLIBMM_ENABLE_PROPERTIES unset:
> #cellrenderercustom
>
> Dunno if thats important or not though.
That's a different example.
There's a note in the ChangeLog about that.
Murray Cumming wrote:
Say I've got a class containing a list of values. For example, a
Palette class containing a list of colors (something like the
following incomplete class declaration):
class Palette
{
public:
typedef std::vector color_list_type;
// snipped other
> Say I've got a class containing a list of values. For example, a
> Palette class containing a list of colors (something like the
> following incomplete class declaration):
>
>class Palette
>{
> public:
> typedef std::vector color_list_type;
> // snipped other met
51 matches
Mail list logo