RE: [gnomemm] How to use persistent history with GnomeEntry?



> From: Christopher Smith [mailto:x xman org] 
> On Mon, 2003-10-20 at 10:19, Murray Cumming Comneon com wrote:
> > > Keep in mind that your existing
> > > behavior is exactly correct for those who create their 
> > > entries by passing a null to gnome_entry_new.
> > 
> > Is there a difference between "" and NULL here? They are normally 
> > treated the same by GTK+ and GNOME.
> 
> In this case they are not, and I'd argue this is correct behavior.
> 
> > If "" is an invalid and useless value, then the 
> implementation should 
> > just
> 
> "" turns out to be a valid history id, and could actually 
> prove to be valid and useful in certain scenarios. I could 
> imagine a scenario where it was used as the default history 
> id for controls in an app.

OK, then 2 constructors will be ncessary. Automatically-written constructors
with _CTOR_DEFAULT() and _WRAP_CTOR() should do it.

> > I don't think it's a useful distinction unless you are 
> playing around 
> > with pointers and character arrays without the benefit of a string 
> > class. I see no need of the null-string concept here.
> 
> This tends to be a bit of a political issue, but I'd argue 
> that a C programmer who can't distinguish between pointers 
> and values is not going to go very far without shooting 
> themselves in the foot.

We are C++ coders. I agree about the C coders.

> > This bug should at least be in bugzilla.
> 
> Hmmm... you referring to the gnomemm issue or the fact that
> set_history_id() behaves the way it does?

The latter, because it sounds like you are dealing with the first problem
and you already intend to put a patch in bugzilla for that.

> I could see where the 
> developers might have chosen that approach (although I'd sure 
> like to see an explicit "load_history_from_id()" type 
> function), as otherwise, setting the history id for an Entry 
> object could potentially wipe out it's current history.

If the C++ wrapper doesn't behave like the C version then it's a gnomemm
bug.

Murray Cumming
www.murrayc.com
murrayc usa net



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