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



> From: Christopher Smith [mailto:x xman org] 
> On Mon, 2003-10-20 at 09:42, Murray Cumming Comneon com wrote:
> > It should be
> >   _WRAP_CONSTRUCTOR(Entry(const Glib::ustring history_id), 
> > gnome_entry_new) Instead of
> >   _CTOR_DEFAULT()
> 
> I think you may want both.

Sorry, I meant 
  _WRAP_CONSTRUCTOR(Entry(const Glib::ustring history_id = Glib::ustring())

> 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.

If "" is an invalid and useless value, then the implementation should just
pass a NULL when history_id.empty(). Constructors can be manually
implemented - search for _CONSTRUCT in .ccg files.

> You could try 
> special casing the empty string case, but personally I'm a 
> big fan of the "a null is not the same as an empty string" theory.

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.

> > I would like you to try that and submit a patch. Instructions are 
> > here: http://www.gtkmm.org/bugs.shtml Unfortunately we can 
> not break 
> > the API in the libgnomeuimm 2.0.x series. See my other email today 
> > about APIs and schedules.
> 
> Yeah, I'll crack away at this to see if I can get something 
> that I like. Thanks again for the documentation pointer.
> 
> > But I would expect the default constructor to work also if you use
> > set_history_id() immediately after constructing.
> 
> Yeah, it does work, indeed, you don't have to ever invoke 
> set_history_id(). If you never set it, then your "history" is 
> never persisted. If you set_history_id() after creation, it 
> doesn't appear to load the history, but will persist it. 
> Bizarre but true.

This bug should at least be in bugzilla.

Murray Cumming
www.murrayc.com
murrayc usa net



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