[gnotepad-users] gnotepad+ 1.3.0pre4 (April-25-2000) - some thoughts
Brought to you by:
ackahn
From: Dermot M. <de...@gl...> - 2000-04-26 17:10:40
|
Hello everyone, I have just been trying the latest gnotepad and it seems way, way better than when I tried it some time ago - thanks for all your work Andy. Some things came to mind while editing some HTML - in no particular order. 1) The 'Apply' button in the Preferences dialog did not apply the changes and I had to restart gnp to make changes (eg the editing font) happen. This was the first time that I ran gnp and it seems OK now. 2) The GtkXmHTML (doc) does not reflect unsaved changes made to the HTML even though the GtkXmHTML (window) seems to. 3) Undo stops working after inserting from the HTML menu (eg Title). 4) I could leverage all your good work in a little app that I am writing if I could tell gnp to open another document (tab). I realise that I can start a whole new gnp each time but I think that it would be cleaner to have all the open docs available in one place. 5) Is it possible to show the full path name of the documents somewhere? Either a tooltip over the tab label or a status bar message would be good. Also the recent files menuitems (or a tooltip?) - I get lost with 6 files called 'index.html'. 6) I have seen this warning several times - I don't know when. Gtk-WARNING **: gtk_signal_disconnect_by_func(): could not find handler (0x8053F50) containing data (0x81C9380) 7) I have seen this - again I don't know what caused it: GLib-CRITICAL **: file gmain.c: line 500 (g_source_remove): assertion `tag > 0' failed. 8) What about a simple signal handler for a GtkXmHTML (doc) 'activate' to load and raise the clicked URL (if it is a local HTML file)? 9) I know that syntax highlighting is a lot of work to achieve but I have done some HTML pseudo-highlighting (in perl) with the sub below. Perhaps it could be a user option although I don't think that this trivial tag highlighting is very expensive. Still it might need another couple of user preferences (HTML_tag_color and HTML_comment_color) to be really friendly. Please excuse my bad coding style - and also that it's in perl :) I don't know C but I guess that this approach would map fairly well. I only re-show the HTML on a notebook page switch or a user-request but it seems pretty snappy on small files. BTW perl's index looks in a string (eg $html) for a character (eg '<'), starting at offset (eg $pos) and returns the new offset if found or -1. sub show_html { my ($class, $textbox, $html) = @_; my $pos = 0; my ($tag, $prev_contents); my $new_pos; my $cm = $textbox->get_toplevel->window->get_colormap; my $plain_color = $cm->color_alloc({red=>0, green=>0, blue=>0}); my $tag_color = $cm->color_alloc({red=>0, green=>0, blue=>65535}); my $comment_color = $cm->color_alloc({red=>65535, green=>0, blue=>0}); my $plain_font = Gtk::Gdk::Font->load( '-b&h-lucidatypewriter-medium-*-*-*-*-120-*-*-*-*-*-*'); my $tag_font = $plain_font; my $comment_font = $plain_font; $textbox->freeze; $textbox->delete_text(0, -1); while (($new_pos = index($html, "<", $pos)) > -1) { $prev_contents = substr($html, $pos, $new_pos-$pos); $pos = $new_pos; $new_pos = index($html, ">", $pos); $tag = substr($html, $pos, $new_pos-$pos+1); $pos = $new_pos+1; $textbox->insert($plain_font, $plain_color, undef, $prev_contents); if ($tag =~ /^\<\s*!--/) { $textbox->insert($comment_font, $comment_color, undef, $tag); } else { $textbox->insert($tag_font, $tag_color, undef, $tag); } } $prev_contents = substr($html, $pos, $new_pos-$pos); $textbox->insert($plain_font, $plain_color, undef, $prev_contents); $textbox->thaw; } Apologies for the long posting and thanks again. Regards, Dermot. PS This is the info from my build. dermot 03:28:38 - ~ >$ gnp --info gnotepad+ 1.3.0pre4 (April-25-2000) Compiled by de...@hi...twrights.farm on Wed Apr 26 02:37:05 BST 2000 Compile/Link info: GTK version = 1.2.7 GNOME version = gnome-libs 1.0.58 CC = gcc GTK_CFLAGS = -I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include CFLAGS = -g -O2 -Wall -Wmissing-prototypes -Wno-implicit-int -I/usr/local/include -DNEED_GNOMESUPPORT_H -I/usr/local/lib/gnome-libs/include -I/usr/local/lib/glib/include -I/usr/X11R6/include -I/usr/local/include/gnome-xml GTK_LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm LDFLAGS = -rdynamic -L/usr/local/lib -L/usr/X11R6/lib UNAME = Linux higrade.botwrights.farm 2.2.1 #7 Tue Nov 16 02:22:30 GMT 1999 i586 unknown |