Plans for 2.0
by matooo on Jan.05, 2009, under gtk-databind
For first and obvious plan is to squash as many bugs as they’re found.
Other plans (more serious)
A little FAQ
Ok, so now to explain something that I was asked quite a few times. “How can I help?”. Like first by starting providing help on CellRenderers and Custom Widgets, this work requires the least knowledge of any SDB part. Make workable widget class and then either provide Gtk.DataBindings aware extension (even if extension id not provided, work is so simple that it’ll take me few minutes to make that data widget data aware). Same goes for CellRenderers, example of how to make it data aware is in sample1.
Another thing people ask is “I would need this or that”, one way is to hack it your self and ask if you need help on parts you don’t know. Maybe,… maybe…. if idea is good I might even hack it my self. And FFS! Don’t as me to help you with something it is not SDB and GDB related.
The more annoying part is “MS has this and that”, MS databindings are also plagued by insanity. Main feature of Data bindings is to separate gui code from data code. Last thing you want is to have form code as large as ms can become by simple databinding. By that, first provide with problem, don’t start hacking some solution
And most heard continuation of previous argument is “Tried hacking into your source, but couldn’t find anything, so I started writing my solution”. Well, before you start doing that, try asking.
Nicest example are converters and validators.
private DateTime somedate = DateTime.Now;
public DateTime SomeDate {
get { return (somedate); }
set {
if (somedate == value)
return;
somedate = value;
if (PropertyChanged != null)
PropertyChanged (this, new PropertyChangedEventArgs("SomeDate"));
}
}
// Every .Net editor can fold this region
#region SOMEDATE_CONVERTERS
public int Day {
get { return (somedate.Day()); }
set {
// insert validation if you want
if (somedate.Day == value)
return;
SomeDate = new DateTime(somedate.Year, somedate.Month, value);
}
}
public string Month {
get { return (MonthNames[somedate.Month]); }
set {
int i = MonthNames.IndexOf(value);
if ((i == -1) || (i == somedate.Month))
return;
SomeDate = new DateTime (somedate.Year, i, somedate.Day);
}
}
public string SomeDateAsString {
get { return (SomeDate.ToString()); }
}
#endregion SOMEDATE_CONVERTERS
public string StatusDate {
get { return ("Today is " + SomeDateAsString); }
}
note,… all properties are alive and boundable. And all widgets are updated when you change any of those. All code is validated, and everything is converted correctly according to your needs.
Although data Converter/Validator is really simple to integrate (and I might even allow it as it doesn’t enforce any strain on user, but then again promotes having whole bunch of non-sense code). But I won’t be writing one single line of code for them, because they are non sense in my eyes.
And what about widget validation? Simple solution, when writing for example DateEntry, DON’T USE HALF ASSED APPROACH by using some MaskedEntry, make widget really usable and specifically for Date editing.
February 7th, 2009 on 11:23 am
Great job. Thanks your.