From 39f104cbce5414f0fe79df244f7dcef32ad5e032 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 1 Nov 2024 16:40:21 +0100 Subject: [PATCH] catego --- elcategorizator.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/elcategorizator.py b/elcategorizator.py index d134464..d82aa03 100644 --- a/elcategorizator.py +++ b/elcategorizator.py @@ -1119,9 +1119,9 @@ class ListForCateWords(ListForCate) : # if y > rect.y - self.GetItemRect(0).y + rect.height/2: # index += 1 #print('Insert de ListForCateWords', index,flags) - - categorie = self.parent.m_listCate.getColumnText(self.parent.m_listCate.GetFirstSelected(),0) - if categorie is not None : + if self.parent.m_listCate.GetFirstSelected() != -1 : + categorie = self.parent.m_listCate.getColumnText(self.parent.m_listCate.GetFirstSelected(),0) + #if categorie is not None : if seq[0][-1] == 'words' : for val in seq : word, eff = val[1] @@ -1132,8 +1132,10 @@ class ListForCateWords(ListForCate) : self.parent.m_listToCate.RefreshData(self.dlist) self.parent.butsave.SetBackgroundColour((255,0,0,255)) self.parent.Refresh() - - + else : + message = wx.MessageDialog(self, _("You have to select a category first"), _("Information"), wx.OK|wx.ICON_INFORMATION) + message.ShowModal() + message.Destroy() class MyListDropCate(wx.DropTarget): """ -- 2.7.4