How to delete all elements in one command for a tk treectrl - tk-toolkit

I want to delete all elements in a tk treectrl , I find commands like pathName item delete , but not sure how can it be done with single command

Got the answer pathName item delete all
http://tktreectrl.sourceforge.net/treectrl.html#91

Related

How do I type a path of a file if a folder has spaces in its' name and I can't/don't want to change it's name?

I'm using cmder as my command line and if I want to access folders inside a given one i'm already in, e.g. doing cd [foldername], I don't know how to access folders that have spaces in them because then cmder only processes the first word in the folder name instead of the full name.
How about:
cd "folder with space"
And you can also press tab before typing name and cmd will help you out.

How Can I Handle Parameters With Spaces in Delphi?

My program accepts input file names either as command line parameters or in a drag and drop operation or in Explorer by clicking on filenames with an extension that is associated with my program.
The command line and drag and drop work fine, but it is clicking on the filenames in Explorer that causes problems when the filepaths of the files clicked on have spaces in them, e.g.:
c:\temp\file one.txt
c:\my directory\filetwo.txt
c:\my directory\file three.txt
then, the ParamStr function gives me back:
ParamStr(1): c:\temp\file
ParamStr(2): one.txt
ParamStr(3): c:\my
ParamStr(4): directory\filetwo.txt
ParamStr(5): c:\my
ParamStr(6): directory\file
ParamStr(7): three.txt
How can I best reconstitute these back into the three filenames that I need?
It might be your shell file association that does not include the pair of "".
Like these ones for opening:
"C:\Program Files\WinRAR\WinRAR.exe" "%1"
or with DDE message:
[open("%1")]
Command-line parameters with spaces in them, such as filenames, should be quoted. This makes the param parser realize that it's supposed to keep them together. If the user's not quoting the filename, it's operator error.
If a drag-and-drop system is doing this, on the other hand, then you've got a bug in your drag-and-drop library and you need to talk to whoever created it. I'm a bit confused, though, as to why drag-and-drop operations are messing with ParamStr. That should only be set by the params passed to your program at the moment it's invoked, not once it's up and running. Maybe I'm missing something?
i use the CmdLineHelper unit, from here.

insert line into file using rails templates

I am trying to create a rails template that will add code to files at particular line numbers. For example I need to add a route to the config/routes.rb
I have tried sed, gsed(only cause I am on a mac and they say that sed has problems with insert and append), anyway, I was not able to achieve the result I want.
Any help on this will be greatly appreciated.
I have tried several permutations of this command, but none work, here is an example
run "gsed '3 a/This is it' config/routes.rb"
perhaps even another suggestion
EDIT::::::
ok I took a break and when I came back, after reading up on sed, I realized that I needed to write the stream back to the file, but I was doing this before with,
run "gsed '2 a\
Add this line after 2nd line
' config/routes.rb > config/routes.rb"
but the routes file would be blank, so I tried using a different filename(new.routes.rb),
run "gsed '2 a\
Add this line after 2nd line
' config/routes.rb > config/new.routes.rb"
and this worked, so I know what to do now.
Since line numbers change as your file evolves, it's better to insert your new code before or after existing string expressions. Inside your template generator, you can do something like this:
inject_into_file 'config/application.rb', :before => " end" do
"\n config.logger = Logger.new(config.paths.log.first, 50, 1048576)\n\n"
end
Note, you can use :after if :before doesn't meet your needs.
I have to wonder why you're using sed for this. Write a Ruby script to open up the file, read it in line by line, make your changes and write the file back out. About the only problem you're going to have with that is editing a file "in place." To get around that, open up a temporary file, write to that file, then move that file over the old file using File.move.
this will do the trick, just remember to delete the old one and rename the new on in its place
run "gsed '2 a\
Add this line after 2nd line
' config/routes.rb > config/new.routes.rb"

Does Texniccenter or any other tex editor auto-complete references in Latex?

I want to use a latex editor that has auto completion feature for existing references in a latex file. Do you know any good ones? I am trying to find this feature in texniccenter, but I guess it doesn't exist or I could't find it yet.
Update:
Ok, I found how to enable auto completion in Texniccenter. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Texlipse does this, also with Ctrl+Space.
Inlage includes such a function, too. New commands and new environments will also appear in the auto completion list. If you use extern BibTex files the \cite{} command will open a list with your articles and books from you .bib file.
Ok, I found it. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Kile has reference completion. If you type Ctrl+Space inside of a \ref{}, you get a list of all the references (that existed last time you compiled, of course).
LEd presents a click list of them when in a \ref{}
The RefTeX mode for Emacs will do what you're asking for: the shortcut C-c ) activates the "insert a \ref" mode (of course, you can customize which type of reference: fancyref, hyperref, etc) and pressing TAB will allow you to start typing and autocomplete by tabbing again after typing some characters.
It also figures out (or asks if it can't) what sort of ref you're inserting and shows a list of all the defined \labels in your document, selectable with the arrow keys or C-n / C-p.
Now we just need a Vi user to come along and tell us how to do it there...
Now texmaker does, not need any special key.

how to clear the wireshark filter combo contents

Does anyone know how to clear the filter drop down (combo) contents in Wireshark? Are the contents stored in a file somewhere?
For the life of me, I can't figure this out. And, the Wireshark help file only tells me "The entries in the pull down list will remain available even after a program restart."
Sigh...
Answered my own question.
The filter history is stored in
c:\documents and settings\foo\Application Data\Wireshark\recent, where "foo" is your windows user name.
I don't use Wireshark in Linux, so I don't know where this file lives there. I would imagine in your home directory.
In that file, there's a section labeled "######## Recent display filters (latest last), cannot be altered through command line ########". Each recent.display_filter line is an entry in the filter drop down. Just remove the filters you don't want in the drop down, or remove them all to clear the filter history entirely.
They're in ~/.wireshark/recent and named "recent.display_filter".
This is now in %APPDATA%\Wireshark\recent_common
AKA C:\Users\username\AppData\Roaming\Wireshark\recent_common
Look for the ######## Recent display filters (latest last), cannot be altered through command line ######## section.
I found how we can remove saved wireshark filters on Windows10 systems:
First you have to go to this directory C:\Users\<your_username>\AppData\Roaming\Wireshark and open the recent_common file with any text editor and then press on CTRL + f search the name of the filter that you want to delete and delete the whole line and the filter will never come back!
I hope I could help you.

Resources