Re: Completion table and document/DTD association (bug #127125)
Nicolas Centa <[email protected]> Wed, 14 Jan 2004 20:57:52 +0100
| Newsgroups | gmane.editors.mlview.devel |
|---|---|
| Message-ID | <1074110272.1572.3.camel@Thor> |
Hello ! Le mar 13/01/2004 à 13:29, [email protected] a écrit : > Then comes the hidding/showing of the completion widget. > Today, the completion widget is packed in a GtkHPaned widget. > Putting the gutter GtkHPaned at the extreme right hand side would hide > the completion widget. Maybe a simple gtk_widget_hide() (to hide totally the completion table) would be visually and functionnally cleaner. > We could first the following API : > > gboolean > MlViewXMLDocument::is_completion_possible (MlViewXMLDocument *a_this, > xmlNode *a_current_xml_node, > MlViewAppContext *a_ctxt) ; > > It would obviously return TRUE if completion is possible, FALSE otherwise. Yes, I think this API would be useful. > But how to trigger the hidding/showing of the completion widget ? > As I said before, the "completion_is_possible" state is specific to each xml > node. So each time the user selects an xml node, we can just hide/show the > completion widget. To achieve this, we can connect to the > MlViewXMLDocument::node_selected signal (in MlViewTreeView::construct()), > test if completion is possible, and show/hide the completion widget accordingly. Maybe showing the completion table when the user selects a node which supports completion, and then hiding it when he selects another node which does not support it, and then showing it again, etc. is not a very good idea for the GUI. I think we could enable the completion table for views associated with documents which have an usable DTD (when validation is activated) because some completion can be done with some of their nodes, and 'disable' it (or simply do nothing, visually speaking, in fact ; but we can also notice the user that the node is invalid (maybe that's too complicated, I don't know)) when completion is not possible on the current node. Thus, we could need another API to know if a DTD is associated with a document, and signals to know when a DTD becomes associated with the document, just like I said before. Personnally, your proposal perfectly suits me, I just wanted to have your opinion (and the opinion of everybody on this mailing list :-) on these few GUI points. Cheers, Nicolas Centa