Gtkmm-forge digest, Vol 1 #1078 - 6 msgs



Send Gtkmm-forge mailing list submissions to
	gtkmm-forge lists sourceforge net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gtkmm-forge
or, via email, send a message with subject or body 'help' to
	gtkmm-forge-request lists sourceforge net

You can reach the person managing the list at
	gtkmm-forge-admin lists sourceforge net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gtkmm-forge digest..."


gtkmm-forge is the mailing list that receives gtkmm bug reports from bugzilla.  A daily digest is sent to gtkmm-main, to encourage people to help fixing the bugs. Do not try to unsubscribe gtkmm-forge from gtkmm-list.


Today's Topics:

   1. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))
   2. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))
   3. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))
   4. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))
   5. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))
   6. [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es (gtkmm (bugzilla.gnome.org))

--__--__--

Message: 1
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 13:02:31 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #18 from baltasarq yahoo es  2006-03-09 18:02 UTC -------
Created an attachment (id=3D60993)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=3D60993&action=3Dview)
Example of use of ListViewText

The attached files are a very tiny example of use of listviewtext. It is =
a
window divided in three parts:
- A simple listbox
- A simple stringrid showing some values
- A simple stringrid showing values that are editable

listviewtext.cpp and .h are included as well


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


--__--__--

Message: 2
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 13:58:55 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #19 from jonner  2006-03-09 18:58 UTC -------
Good work Baltasar,
I'm not sure I'm completely happy with the API yet, though.  I think it w=
orks
well for a one-column TreeView, but it feels clumsy for the multi-column =
case.=20
For example, when you've got multiple columns, you add a new row by speci=
fying
the content of the first column with append_text().  Then you have to spe=
cify
the content of the remaining columns one-by-one, but using a different
function, set_text().  It just doesn't feel right to me.  I'd like to do
everything at once, preferably by specifying all column values as argumen=
ts to
append_text() (though I admit this would be difficult to achieve).  If th=
is
isn't possible, it seems that they should all use the same interface for =
all
column values instead of having one function for the first column and a
different function for the others.  For example, you could change=20
void append_text(string)=20
to something like
int append(void)
which would return the row index that you could then use to set all colum=
n
values with set_text(...).  Admittedly, this makes the single-column case=
 more
clumsy, so it's probably not a great solution either [By the way, this is=
 all
just off the top of my head -- I haven't thought through this API much ei=
ther,
just tossing out ideas]. =20

A few other thoughts:
- Several functions check the size of the TreeView before performing
operations.  They just do nothing if the argument is too large.  Do we wa=
nt to
use some sort of assert instead? something like g_return_if_fail() or
g_assert()?  I'm not sure about this one, just thought I'd pose the quest=
ion.
- gtkmm uses a file extension .cc instead of .cpp


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


--__--__--

Message: 3
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 14:13:19 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #20 from Murray Cumming  2006-03-09 19:13 UTC -------
> For example, you could change=20
> void append_text(string)=20
> to something like
> int append(void)
> which would return the row index that you could then use to set all col=
umn
> values with set_text(...).

The parameter to append_text() is already optional. But I agree that
append_text() should return the new row number.

I don't see any way other than varargs (...), or a clumsy vector to speci=
fy
additional column values.

Yes, it would probably be a good idea to use the g_ macros.

I've been meaning to give this a last look over and commit it to HEAD. I
haven't been rushed because HEAD won't have a release very soon.


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


--__--__--

Message: 4
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 14:23:18 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #21 from baltasarq yahoo es  2006-03-09 19:23 UTC -------
(In reply to comment #19)
> I'm not sure I'm completely happy with the API yet, though.  I think it=
 works
> well for a one-column TreeView, but it feels clumsy for the multi-colum=
n case.

Actually, I was thinking the same while writing the example, but can't th=
ink of
any other method than passing a vector<string>. Or maybe this possibility=
 could
be added to the already present ones.

> For example, when you've got multiple columns, you add a new row by spe=
cifying
> the content of the first column with append_text(). =20

Yes, but this is not mandatorily needed to be carried out this way: you c=
an
call append() with no arguments and then fill all cells with set_text().

> Then you have to specify
> the content of the remaining columns one-by-one, but using a different
> function, set_text().  It just doesn't feel right to me.

Yeah, I understand. :-)

>  I'd like to do
> everything at once, preferably by specifying all column values as argum=
ents to
> append_text() (though I admit this would be difficult to achieve).

Mmmm ... a variable argument list ?

>  If this
> isn't possible, it seems that they should all use the same interface fo=
r all
> column values instead of having one function for the first column and a
> different function for the others.  For example, you could change=20
> void append_text(string)=20
> to something like
> int append(void)
> which would return the row index that you could then use to set all col=
umn
> values with set_text(...).

It is possible to return the column in any case. I think it is a good ide=
a.

>  Admittedly, this makes the single-column case more
> clumsy, so it's probably not a great solution either [By the way, this =
is all
> just off the top of my head -- I haven't thought through this API much =
either,
> just tossing out ideas]. =20

Don't worry, that's great, maybe we can find a better solution this way !

> A few other thoughts:
> - Several functions check the size of the TreeView before performing
> operations.  They just do nothing if the argument is too large.  Do we =
want to
> use some sort of assert instead? something like g_return_if_fail() or
> g_assert()?  I'm not sure about this one, just thought I'd pose the que=
stion.

I asked about this before (see comments #16 and #17) but received no answ=
er
(I'm not giving you a hard time). So I decided to look into the gtkmm sou=
rce
code and saw (to my onw surprise) that at least the components I look int=
o
(comboboxtext, I think) didn't do anything in that case (or maybe g_* was=
 there
but I didn't realise). I don't know about g_return_if_fail(), but I would=
 be
glad to include these error checks if any you can put me an example or ad=
dress
me to any source code.

> - gtkmm uses a file extension .cc instead of .cpp

okaaaaaaaaay

Salud !

Baltasar


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


--__--__--

Message: 5
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 15:08:43 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #22 from jonner  2006-03-09 20:08 UTC -------
(In reply to comment #20)

> The parameter to append_text() is already optional. But I agree that
> append_text() should return the new row number.

True, the parameter is optional, but It feels weird to call a function na=
med
append_text() without specifying any text.  Maybe it wouldn't feel as odd=
 to me
if the function were named append() or append_row() or something like tha=
t.=20
But the advantage of append_text() is that it remains consistent with the
ComboBoxText class.

> I don't see any way other than varargs (...), or a clumsy vector to spe=
cify
> additional column values.

Yeah, I don't particularly like either of those options, especially varar=
gs
since it's not typesafe.  and if you use a vector, you've got to decide w=
hat to
do in the case where the vector contains too many items or not enough ite=
ms.=20
Maybe the existing API is the best we can do for now.  I suppose there's
nothing stopping us from adding an alternate set_text API if we come up w=
ith a
better way in the future.


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


--__--__--

Message: 6
To: gtkmm-forge lists sourceforge net
From: "gtkmm (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
Date: Thu,  9 Mar 2006 15:45:48 -0500 (EST)
Subject: [gtkmm bugzilla] [Bug 329333] A convenient wrapper of TreeView for simple ListBox'es

Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=3D329333
 gtkmm | TreeView | Ver: 2.8.x





------- Comment #23 from jonner  2006-03-09 20:45 UTC -------
(In reply to comment #21)
>=20
> I asked about this before (see comments #16 and #17) but received no an=
swer
> (I'm not giving you a hard time). So I decided to look into the gtkmm s=
ource
> code and saw (to my onw surprise) that at least the components I look i=
nto
> (comboboxtext, I think) didn't do anything in that case (or maybe g_* w=
as there
> but I didn't realise). I don't know about g_return_if_fail(), but I wou=
ld be
> glad to include these error checks if any you can put me an example or =
address
> me to any source code.

These are just simple macros provided by Glib [1].

So, for example, you could change the set_column_title function from:

void ListViewText::set_column_title(unsigned int column, const Glib::ustr=
ing&
title)
{
  if ( get_columns().size() > column ) {
    get_column( column )->set_title( title );
  }
}

to:

void ListViewText::set_column_title(unsigned int column, const Glib::ustr=
ing&
title)
{
  g_return_if_fail( get_columns().size() > column );
  get_column( column )->set_title( title );
}

For non-void functions, you'd need to use g_return_val_if_fail() instead.

[1]
http://developer.gnome.org/doc/API/2.0/glib/glib-Warnings-and-Assertions.=
html


--=20
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=3Demail
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



--__--__--

_______________________________________________
Gtkmm-forge mailing list
Gtkmm-forge lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtkmm-forge


End of Gtkmm-forge Digest



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