[MonoDevelop] Random crashes... is this normal?
Gergely Kiss
mail.gery at gmail.com
Thu Jan 31 03:04:43 EST 2008
Dear users and developers,
I experience random crashes while using Stetic. I've been working on an
accounting project in MonoDevelop and I often get exceptions and crashes
while using the built-in GUI designer.
I've been seeing this issue for quite a long time and I still couldn't find
a solution.
Things I know about the problem:
- Exception messages show up randomly, but always with a similar message
(something bad happened while handling an event with some kind of a focus
event)
- If there aren't any error messages, the user interface stops responding to
any interaction, after that, the main window of MD closes.
- Some version info:
o Ubuntu 7.10 (Gutsy Gibbon)
o GTK# 2.10.2
o MonoDevelop version: 0.18 compiled from SVN source, I got no errors
while compiling
o Mono.Addins: 0.3
o Mono 1.2.4 (installed automatically with my OS. Other .NET applications
work perfectly, so I think the problem is in the MD source somewhere)
Please help me finding the reason of these crashes.
I'd like to ask two more questions (if you don't mind):
1, I found a nice tutorial on how to use TreeView widgets. Following the
steps described there, I set up a filter, so I can filter the stocks and
customers database in my application - in theory. In fact, if I input any
kind of text into the search entry, nothing happens at all.
I wonder what the hell could be wrong in my code. Please have a look at it
(it's not too long so I post it right here):
Gtk.TreeModelFilter filter;
public StockDBEdit()
{
if(MySqlFunctions.ConnectDB() == null)
{
this.Destroy();
return;
}
this.Build();
treeview_keszletek.AppendColumn ("Azonosító", new
Gtk.CellRendererText (), "text", 0);
treeview_keszletek.AppendColumn ("Megnevezés", new
Gtk.CellRendererText (), "text", 1);
treeview_keszletek.AppendColumn ("Elérhető mennyiség", new
Gtk.CellRendererText (), "text", 2);
treeview_keszletek.AppendColumn ("ÁFA-kulcs", new
Gtk.CellRendererText (), "text", 3);
treeview_keszletek.AppendColumn ("Nettó egységár", new
Gtk.CellRendererText (), "text", 4);
treeview_keszletek.AppendColumn ("Bruttó egységár", new
Gtk.CellRendererText (), "text", 5);
Gtk.ListStore tmpListStore = new Gtk.ListStore (typeof (string),
typeof (string), typeof (string), typeof (string), typeof (string), typeof
(string));
Gtk.ListStore dataListStore = new Gtk.ListStore (typeof
(string), typeof (string), typeof (string), typeof (string), typeof
(string), typeof (string));
if ((tmpListStore = Product.GetProductsDataFromDB()) != null)
dataListStore = tmpListStore;
else
PopupDialog.ShowInformation("Nincsenek bejegyzések","Az
adatbázis nem tartalmaz bejegyzéseket.\nÚj termék vagy szolgáltatás
felvételéhez használja az Új termék/szolgáltatás... gombot.");
filter = new Gtk.TreeModelFilter (dataListStore, null);
filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc(FilterTree);
treeview_keszletek.Model = filter;
}
The code you can see above is the constructor of my stock database editor.
In a nutshell, my code does the following:
1, If there's any error while connecting to the database server, it closes
the window. (Error message is shown by the ConnectDB() function).
2, Append the required columns to the TreeView.
3, Fetch data from the database, and save it as a ListStore object.
4, I can't really explain the last three lines, in fact, I just copied them
out of the tutorial. :)
My FilterTree function looks like this:
private bool FilterTree (Gtk.TreeModel model, Gtk.TreeIter iter)
{
string productName = model.GetValue (iter, 1).ToString ();
if (entryFilter.Text == "")
return true;
if (productName.IndexOf (entryFilter.Text) > -1)
return true;
else
return false;
}
And I have an event handler applied to the search entry, it looks like as
follows:
protected virtual void OnEntry3Changed (object sender, System.EventArgs e)
{
filter.Refilter();
}
That's all I did in my code, am I missing something? The code compiles
perfectly, no errors, no warnings at all.
But if I try to input any text into the search entry... the list of stocks
doesn't change at all.
Any ideas?
Thank you in advance!
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20080131/c27b638a/attachment-0001.html
More information about the Monodevelop-list
mailing list