New facility to search Help files

View: New views
15 Messages — Rating Filter:   Alert me  

New facility to search Help files

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -

Prompted by some of the recent interesting discussion over SC
usability, I added a feature to search Help files. It's in SVN (rev
7541, 7542). You can run

   Help.searchGUI

to pop up the GUI. It's crossplatform too! No naughty mac-specific-ness here :)

As part of this, I created a new primitive to strip HTML quickly down
to plain-text, String:stripHTML.

Comments welcome. It's fairly basic (e.g. search is simple
string-matching) but hopefully useful.

Dan

--
http://www.mcld.co.uk
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Parent Message unknown Re: [sc-users] New facility to search Help files

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cool. I'd like to add a menu item to the Mac GUI, so that there's a
nice keyboard shortcut for it. Possible keyboard shortcuts:

[Cmd-Alt-Shift-D] - fits with the other help menu items, but four-keys
is a bit heavy for some people

[Cmd-Alt-S] - "s" for "search", but slightly dubious because the "s"
button is normally used for save-like actions

thoughts?


2008/5/5 thor <th.list@...>:

>
>  Hey Dan
>
>  That works very well. A bit slow on my machine at times, but hey,
>  it's old and shaky.
>
>  It will be interesting to use the searchGUI as part of the work
>  process. I'll let you know if I have
>  comments.
>
>  thor
>
>
>
>
>
>  On 5 May 2008, at 12:21, Dan Stowell wrote:
>
>
>  > Hi -
>  >
>  > Prompted by some of the recent interesting discussion over SC
>  > usability, I added a feature to search Help files. It's in SVN (rev
>  > 7541, 7542). You can run
>  >
>  >    Help.searchGUI
>  >
>  > to pop up the GUI. It's crossplatform too! No naughty mac-specific-
>  > ness here :)
>  >
>  > As part of this, I created a new primitive to strip HTML quickly down
>  > to plain-text, String:stripHTML.
>  >
>  > Comments welcome. It's fairly basic (e.g. search is simple
>  > string-matching) but hopefully useful.
>  >
>  > Dan
>  >
>  > --
>  > http://www.mcld.co.uk
>
>
> > _______________________________________________
>  > sc-users mailing list
>  > sc-users@...
>  > http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
>  _______________________________________________
>  sc-users mailing list
>  sc-users@...
>  http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>



--
http://www.mcld.co.uk
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Scott Wilson-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cmd-alt-f
?

On 5 May 2008, at 21:03, Dan Stowell wrote:

> Cool. I'd like to add a menu item to the Mac GUI, so that there's a
> nice keyboard shortcut for it. Possible keyboard shortcuts:
>
> [Cmd-Alt-Shift-D] - fits with the other help menu items, but four-keys
> is a bit heavy for some people
>
> [Cmd-Alt-S] - "s" for "search", but slightly dubious because the "s"
> button is normally used for save-like actions
>
> thoughts?
>
>
> 2008/5/5 thor <th.list@...>:
>>
>> Hey Dan
>>
>> That works very well. A bit slow on my machine at times, but hey,
>> it's old and shaky.
>>
>> It will be interesting to use the searchGUI as part of the work
>> process. I'll let you know if I have
>> comments.
>>
>> thor
>>
>>
>>
>>
>>
>> On 5 May 2008, at 12:21, Dan Stowell wrote:
>>
>>
>>> Hi -
>>>
>>> Prompted by some of the recent interesting discussion over SC
>>> usability, I added a feature to search Help files. It's in SVN (rev
>>> 7541, 7542). You can run
>>>
>>>   Help.searchGUI
>>>
>>> to pop up the GUI. It's crossplatform too! No naughty mac-specific-
>>> ness here :)
>>>
>>> As part of this, I created a new primitive to strip HTML quickly  
>>> down
>>> to plain-text, String:stripHTML.
>>>
>>> Comments welcome. It's fairly basic (e.g. search is simple
>>> string-matching) but hopefully useful.
>>>
>>> Dan
>>>
>>> --
>>> http://www.mcld.co.uk
>>
>>
>>> _______________________________________________
>>> sc-users mailing list
>>> sc-users@...
>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>>
>> _______________________________________________
>> sc-users mailing list
>> sc-users@...
>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>>
>
>
>
> --
> http://www.mcld.co.uk
> _______________________________________________
> Sc-devel mailing list
> Sc-devel@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This all makes me think once again about adding method searching to
the class browser. A couple of months ago I added searching for class
names but at the time didn't think of method searching. Looking for
"index," say, and being able to browse to Bus:index,
Collection:detectIndex etc. would be very nice indeed.

Not much time but I'll try to do something with that in the next
couple of weeks.

I bet the class browser is under-utilized... I at least find it a
quicker reference for method signatures than the help :)
hjh


--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by thor-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Dan. 

I made some cosmetics for the following reasons:

- the textfield was rather large. No reason.
- since this is for new users as well I added a "search" button (not everybody know to press enter on textfield)
- I changed the textfield to textview. It behaves more like people are used to. (not without problems though)
- added elasticity for those with big screens that want to drag the window
- green background in order to separate the search space from the result space

Comment: Searching for something like "sin" gives you all kinds of files where the word
"sing" is used. Is it not possible to search for "sin" only?

Is this of interest:?

*searchGUI {
var win, qbox, resultsview, results, winwidth=600;
var sbut, note;


win = GUI.window.new("<< Search SC Help >>", Rect(100, 400, winwidth, 600));


GUI.userView.new(win, Rect(0, 0, winwidth, 50)) .drawFunc_({
GUI.pen.color = Color.green.alpha_(0.2);
GUI.pen.fillRect(Rect(0, 0, win.bounds.width, 40));
});


// SCTextField
qbox = GUI.textView.new(win, Rect(300, 10, 200, 20))
.resize_(3)
.keyDownAction_({arg view, char, modifiers, unicode, keycode;
if((keycode == 36) || (keycode == 52), {
sbut.valueAction;
});
});


sbut = GUI.button.new(win, Rect(510, 10, 70, 20))
.resize_(3)
.states_([["search", Color.black, Color.grey.alpha_(0.8)]])
.action_({
resultsview.removeAll;
if(qbox.string != ""){
results = this.search(qbox.string);
// Now add the results!
results.do{|res, index|
res.drawRow(resultsview, Rect(0, index*30, winwidth, 30));
};
};
});


// SCScrollView
resultsview = GUI.scrollView.new(win, Rect(0, 50, winwidth, 550))
.resize_(5);


note = GUI.staticText.new(resultsview, Rect(10, 10, winwidth-20, 200))
.string_("Type a word above and press enter.\nResults will appear here.")
.resize_(5);


win.front;
qbox.focus;
^win;
}


_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by felix-38 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

crucial menu has method and class search that allows partial string matching.



On Mon, May 5, 2008 at 10:33 PM, James Harkins <jamshark70@...> wrote:
This all makes me think once again about adding method searching to
the class browser. A couple of months ago I added searching for class
names but at the time didn't think of method searching. Looking for
"index," say, and being able to browse to Bus:index,
Collection:detectIndex etc. would be very nice indeed.

Not much time but I'll try to do something with that in the next
couple of weeks.

I bet the class browser is under-utilized... I at least find it a
quicker reference for method signatures than the help :)
hjh



_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi thor -

Thanks for having a fiddle with the GUI, your attention is welcome :)
although I'm actually going to take issue with some of your
suggestions:

> - since this is for new users as well I added a "search" button (not
> everybody know to press enter on textfield)

I understand the motivation but I don't agree with this. Three reasons:
(1) I have seen a lot of beginner users and if there is a "search"
button, a lot of people don't learn the more efficient way (i.e. to
press enter) and continue to reach for the mouse to launch the search.
(2) The dialog box explicitly tells people to press enter.
(3) A lot of interfaces now use the no-button approach - e.g. the
web-search box in Safari/Firefox/IE/Camino, the search boxes plastered
all over the Mac OSX interface. It look like it's becoming standard
for search boxes!

> - I changed the textfield to textview. It behaves more like people are used
> to. (not without problems though)

Huh? A textview is for multiline text, while a textfield is for single
lines, just like in this case. What behaviour are you referring to?

Textview gives the weird behaviour of starting a new line when you
press enter, not at all what people are used to in search dialogs.

> - added elasticity for those with big screens that want to drag the window

Woo!

> - green background in order to separate the search space from the result
> space

That looks very arbitrary to me. I'd be happier with (e.g.) a thin
separating line.

> Comment: Searching for something like "sin" gives you all kinds of files
> where the word
> "sing" is used. Is it not possible to search for "sin" only?

NO! Not possible! Nothing is possible! :)
I was wondering about making it use SC's recently-added regular
expression search rather than plain old string-matching. This would
help for those cases, but POSIX regexes don't have the nice
word-boundary character (\b) that PCRE does. I'm sure there must be a
way of expressing it using POSIX RE though.

Dan
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've just committed (r7547) a menu item and keyboard shortcut for
this. (Scott wins the keyboard shortcut competition, it's cmd-alt-f)

Dan


2008/5/7 Dan Stowell <danstowell@...>:

> Hi thor -
>
>  Thanks for having a fiddle with the GUI, your attention is welcome :)
>  although I'm actually going to take issue with some of your
>  suggestions:
>
>
>  > - since this is for new users as well I added a "search" button (not
>  > everybody know to press enter on textfield)
>
>  I understand the motivation but I don't agree with this. Three reasons:
>  (1) I have seen a lot of beginner users and if there is a "search"
>  button, a lot of people don't learn the more efficient way (i.e. to
>  press enter) and continue to reach for the mouse to launch the search.
>  (2) The dialog box explicitly tells people to press enter.
>  (3) A lot of interfaces now use the no-button approach - e.g. the
>  web-search box in Safari/Firefox/IE/Camino, the search boxes plastered
>  all over the Mac OSX interface. It look like it's becoming standard
>  for search boxes!
>
>
>  > - I changed the textfield to textview. It behaves more like people are used
>  > to. (not without problems though)
>
>  Huh? A textview is for multiline text, while a textfield is for single
>  lines, just like in this case. What behaviour are you referring to?
>
>  Textview gives the weird behaviour of starting a new line when you
>  press enter, not at all what people are used to in search dialogs.
>
>
>  > - added elasticity for those with big screens that want to drag the window
>
>  Woo!
>
>
>  > - green background in order to separate the search space from the result
>  > space
>
>  That looks very arbitrary to me. I'd be happier with (e.g.) a thin
>  separating line.
>
>
>  > Comment: Searching for something like "sin" gives you all kinds of files
>  > where the word
>  > "sing" is used. Is it not possible to search for "sin" only?
>
>  NO! Not possible! Nothing is possible! :)
>  I was wondering about making it use SC's recently-added regular
>  expression search rather than plain old string-matching. This would
>  help for those cases, but POSIX regexes don't have the nice
>  word-boundary character (\b) that PCRE does. I'm sure there must be a
>  way of expressing it using POSIX RE though.
>
>  Dan
>



--
http://www.mcld.co.uk
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by thor-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Dan

> Thanks for having a fiddle with the GUI, your attention is welcome :)
> although I'm actually going to take issue with some of your
> suggestions:

Sure. Good.

>
>> - since this is for new users as well I added a "search" button (not
>> everybody know to press enter on textfield)
>
> I understand the motivation but I don't agree with this. Three  
> reasons:
> (1) I have seen a lot of beginner users and if there is a "search"
> button, a lot of people don't learn the more efficient way (i.e. to
> press enter) and continue to reach for the mouse to launch the search.
> (2) The dialog box explicitly tells people to press enter.
> (3) A lot of interfaces now use the no-button approach - e.g. the
> web-search box in Safari/Firefox/IE/Camino, the search boxes plastered
> all over the Mac OSX interface. It look like it's becoming standard
> for search boxes!

Yes, but I have realised that many people don't make a distinction  
between
ENTER and RETURN and thus will try the RETURN button. That's the  
behaviour
of Safari/Firefox....
That was the reason, but people can learn this of course.

>> - I changed the textfield to textview. It behaves more like people  
>> are used
>> to. (not without problems though)
>
> Huh? A textview is for multiline text, while a textfield is for single
> lines, just like in this case. What behaviour are you referring to?

Double clicking that highlights the whole string and then you can  
write over it.
This is not possible with the textfield.

> Textview gives the weird behaviour of starting a new line when you
> press enter, not at all what people are used to in search dialogs.

Yes : ) That was the problem I was referring to. Could be programmed  
away.

>> - green background in order to separate the search space from the  
>> result
>> space
>
> That looks very arbitrary to me. I'd be happier with (e.g.) a thin
> separating line.

Yes, good as well.

>> Comment: Searching for something like "sin" gives you all kinds of  
>> files
>> where the word
>> "sing" is used. Is it not possible to search for "sin" only?
>
> NO! Not possible! Nothing is possible! :)
> I was wondering about making it use SC's recently-added regular
> expression search rather than plain old string-matching. This would
> help for those cases, but POSIX regexes don't have the nice
> word-boundary character (\b) that PCRE does. I'm sure there must be a
> way of expressing it using POSIX RE though.

Damn those POSIX regexes!

: )
thor





_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2008/5/7 thor <th.list@...>:

>  >> - since this is for new users as well I added a "search" button (not
>  >> everybody know to press enter on textfield)
>  >
>  > I understand the motivation but I don't agree with this. Three
>  > reasons:
>  > (1) I have seen a lot of beginner users and if there is a "search"
>  > button, a lot of people don't learn the more efficient way (i.e. to
>  > press enter) and continue to reach for the mouse to launch the search.
>  > (2) The dialog box explicitly tells people to press enter.
>  > (3) A lot of interfaces now use the no-button approach - e.g. the
>  > web-search box in Safari/Firefox/IE/Camino, the search boxes plastered
>  > all over the Mac OSX interface. It look like it's becoming standard
>  > for search boxes!
>
>  Yes, but I have realised that many people don't make a distinction
>  between
>  ENTER and RETURN and thus will try the RETURN button. That's the
>  behaviour
>  of Safari/Firefox....
>  That was the reason, but people can learn this of course.

Aha. On my system (I'm using 10.4.11, GUI.cocoa) both of those keys
trigger the action. Are you finding that it doesn't, and if so is that
due to GUI.swing?


>  >> - I changed the textfield to textview. It behaves more like people
>  >> are used
>  >> to. (not without problems though)
>  >
>  > Huh? A textview is for multiline text, while a textfield is for single
>  > lines, just like in this case. What behaviour are you referring to?
>
>  Double clicking that highlights the whole string and then you can
>  write over it.
>  This is not possible with the textfield.

I see, yes, that seems kind of nonstandard doesn't it. I wonder why
textfield doesn't behave quite like an ordinary textfield (e.g.
ordinary for Cocoa). Anyone know?

Dan
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by thor-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> Aha. On my system (I'm using 10.4.11, GUI.cocoa) both of those keys
> trigger the action. Are you finding that it doesn't, and if so is that
> due to GUI.swing?

Sorry, my mistake. What got me confused was that once you hit ENTER
(and the text goes from red to black) the RETURN will not work.

But this is also what I think is nonstandard/non-intuitive.

So, having been working with SC for a while and me being confused with
something minor like this, would indicate that there are problems  
with the
usability of the textfield.
(or maybe it is just the oil-paint fumes I have been breathing all  
morning)

thor


>>>> - I changed the textfield to textview. It behaves more like people
>>>> are used
>>>> to. (not without problems though)
>>>
>>> Huh? A textview is for multiline text, while a textfield is for  
>>> single
>>> lines, just like in this case. What behaviour are you referring to?
>>
>>  Double clicking that highlights the whole string and then you can
>>  write over it.
>>  This is not possible with the textfield.
>
> I see, yes, that seems kind of nonstandard doesn't it. I wonder why
> textfield doesn't behave quite like an ordinary textfield (e.g.
> ordinary for Cocoa). Anyone know?
>
> Dan
> _______________________________________________
> Sc-devel mailing list
> Sc-devel@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Scott Wilson-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 7 May 2008, at 14:02, Dan Stowell wrote:
>>>
>> Double clicking that highlights the whole string and then you can
>> write over it.
>> This is not possible with the textfield.
>
> I see, yes, that seems kind of nonstandard doesn't it. I wonder why
> textfield doesn't behave quite like an ordinary textfield (e.g.
> ordinary for Cocoa). Anyone know?

I've occasionally wondered if it shouldn't just be replaced with the  
standard Cocoa one. Lots of people find it confusing.

S.
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by thor-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 7 May 2008, at 22:40, Scott Wilson wrote:

>
> On 7 May 2008, at 14:02, Dan Stowell wrote:
>>>>
>>> Double clicking that highlights the whole string and then you can
>>> write over it.
>>> This is not possible with the textfield.
>>
>> I see, yes, that seems kind of nonstandard doesn't it. I wonder why
>> textfield doesn't behave quite like an ordinary textfield (e.g.
>> ordinary for Cocoa). Anyone know?
>
> I've occasionally wondered if it shouldn't just be replaced with the
> standard Cocoa one. Lots of people find it confusing.

You certainly get my vote. I always use textField (even for one line  
input)
as I find the textView totally bizarre.

thor


_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

Re: [sc-users] New facility to search Help files

by Scott Wilson-8 :: Rate this Message: <