f



tktreectrl - getting text in selection

Hello:
  I'm sorry for asking such a beginner question but I can't seem to
find my answer through docs or the internet so far.  What I want to do,
is get the text in column 1 in all of the currently selected items of a
tktreectrl.  I get the selection easily by calling "set selected_items
[.t selection get]", but what do I do with the list after that?

set selected_items [.t selection get]
set first [lindex $selected_items 0]
set my_column_text [.t get first ???????
# I don't know what to call here to get me the text in the element of
column 1

Thanks for any help you can give me!

0
blaven (9)
6/28/2006 8:54:48 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

2 Replies
343 Views

Similar Articles

[PageSpeed] 10


    set items [$win.list selection get]
    set item [lindex $items 0]
    set id [$win.list item text $item 0]

Ramon Rib�

En Wed, 28 Jun 2006 22:54:48 +0200, blaven@gmail.com <blaven@gmail.com>  
escribi�:

> Hello:
>   I'm sorry for asking such a beginner question but I can't seem to
> find my answer through docs or the internet so far.  What I want to do,
> is get the text in column 1 in all of the currently selected items of a
> tktreectrl.  I get the selection easily by calling "set selected_items
> [.t selection get]", but what do I do with the list after that?
>
> set selected_items [.t selection get]
> set first [lindex $selected_items 0]
> set my_column_text [.t get first ???????
> # I don't know what to call here to get me the text in the element of
> column 1
>
> Thanks for any help you can give me!
>



-- 
Compass Ing. y Sistemas         Dr. Ramon Ribo
http://www.compassis.com        ramsan@compassis.com
c/ Tuset, 8 7-2                 tel. +34 93 218 19 89
08006 Barcelona, Spain          fax. +34 93 396 97 46
0
ramsan (89)
6/29/2006 9:39:25 AM
Thank you very much!


Ramon Rib=F3 wrote:
> set items [$win.list selection get]
>     set item [lindex $items 0]
>     set id [$win.list item text $item 0]
>
> Ramon Rib=F3
>
> En Wed, 28 Jun 2006 22:54:48 +0200, blaven@gmail.com <blaven@gmail.com>
> escribi=F3:
>
> > Hello:
> >   I'm sorry for asking such a beginner question but I can't seem to
> > find my answer through docs or the internet so far.  What I want to do,
> > is get the text in column 1 in all of the currently selected items of a
> > tktreectrl.  I get the selection easily by calling "set selected_items
> > [.t selection get]", but what do I do with the list after that?
> >
> > set selected_items [.t selection get]
> > set first [lindex $selected_items 0]
> > set my_column_text [.t get first ???????
> > # I don't know what to call here to get me the text in the element of
> > column 1
> >
> > Thanks for any help you can give me!
> >
>
>
>
> --
> Compass Ing. y Sistemas         Dr. Ramon Ribo
> http://www.compassis.com        ramsan@compassis.com
> c/ Tuset, 8 7-2                 tel. +34 93 218 19 89
> 08006 Barcelona, Spain          fax. +34 93 396 97 46

0
blaven (9)
6/29/2006 1:47:03 PM
Reply:

Similar Artilces:

How to select all texts of the document of the format of the selected text?
Hi,i have selected a text of the document with the specified font face, color and size in MS Word 2000. Now , I want to select all the relevant texts from the entire document with the same format(face,color and size) as of the selected text. so Is there any method or shortcut to do this op.? Not really. You have to "walk" the document checking the styles as you go along. And You have to watch out for cases where the style changes in the middle of a word (!) and code accordingly to get the desired results. chetan26nov@gmail.com wrote: > Hi,i have selected a text of the documen...

Text bind command not selecting text
I am putting together a small report editor and need some help with the following problem. I would like the user to type in some text and then later be able to select either all of it or a portion of it for formatting (ie. centering, bold, italic,etc.) by typing in a command like Ctrl-A. The following code is what I came up for this process but for some reason the text does not get selected. Can someone tell why this code doesn't work? ################################################################ # use strict ; use Tk ; use Tk::NoteBook ; my $fTab ; my $mw = MainW...

How to change a range selection to text selection?
Hi, i created an editable html container and select a single image within this container. if (document.selection.type == "Control") { var x = document.selection.createRange(); } Now I want to replace this control selection with pasteHTML... which won't work as the selection is not text type. Is there a command to change my control selection to a text selection? Thank you Loebb ...

Deleting selected text from text area
I was wondering if anyone could help. I'm trying to find how to delete text from a selected text Area. I'm a beginner in Java Netbeans. So go easy! This is what I tried but its not happening. int start = 0, end = 1; while ( start < end ) { start = SpeechText.getSelectionStart(); end = SpeechText.getSelectionEnd(); if ( start != end ) remove( SpeechText.getText() ); } tom79l@googlemail.com wrote: > I was wondering if anyone could help. I'm trying to find how to > delete text from a selected text Area. > > I'm a beginn...

trying to disable a text input field when a particular select list option is selected in a select field but this code has no effect
<script> $(document).ready(function () { $('#select_field').change(function(e) { if (e.target.value=='select_value') {e.second_field.disabled = true;} }) }) </script> On 2015-11-30 05:23, fugee279@gmail.com wrote: > <script> > $(document).ready(function () { > $('#select_field').change(function(e) > { > if (e.target.value=='select_value') {e.second_field.disabled = true;} > }) > }) > </script> Next time, please include the error message you see in the console. The para...

How do I 'SELECT All' text in a text box
I want to select all text in a multi line text box from a command butten. Thank for help Dave Try this... Private Sub Command1_Click() With Text1 .SelStart = 0 .SelLength = Len(.Text) .SetFocus End With End Sub Rick - MVP "Dave" <last2try@earthlink.net> wrote in message news:fo0b90h0j9imbvntdea3uu2mefth5teufr@4ax.com... > I want to select all text in a multi line text box from a command > butten. > > Thank for help > Dave ...

tcl sql selecting and retrieving selected fields
hi i would like to retrive two columns from a table, select the last recording and memorise them within two variables the structure of my table is Node, LogDate, LogTime, LogName, FirstValue, LastValue,.......... I'm interested in the LogDate and LogTime recordings What I use doesn't seem to work SQLDIRECT "CONNECT SESSSION 3 TO kerw_ACCESS" SQLDIRECT "USE SESSION 3" SQLDIRECT "DECLARE CURSOR C3" SQLPREPARE "SELECT (LogDate, LogTime) FROM BwAnalogTable" SQLPREPARE "ORDER BY BwAnalogTable.LogTime DESC" SQLEXECUTE SQLDIRECT "OPEN C3" SQLDIRECT "FETCH C3 INTO Mem_DateWA, Mem_TimeWA" set M [list Mem_DateWA Mem_TimeWA" SQLDIRECT "CLOSE C3" SQLDIRECT "DISCONNECT SESSION 3" Thanx crist-y wrote: > hi > i would like to retrive two columns from a table, select the last > recording and memorise them within two variables > the structure of my table is > Node, LogDate, LogTime, LogName, FirstValue, LastValue,.......... > I'm interested in the LogDate and LogTime recordings > What I use doesn't seem to work You may find you get better answers faster if you tell us what error message you are getting or what exactly the program is doing that is unexpected. "doesn't seem to work" is rather vague. > SQLDIRECT "CONNECT SESSSION 3 TO kerw_ACCESS" > SQLDIRECT "USE SESSION 3" > SQLDIRECT "DECLARE CURSOR C3&quo...

Using Control-a to select all text in a text widget
I'm having a difficult time binding Control-a so it selects all the text in a widget just like the default Control-/ binding does. I've tried: ..t bind <Control-a> [.t bind <Control-/>] But [.t bind <Control-/>] returns nothing. If I do: ..t bind <Control-/> {puts "Selecting all"} ..t bind <Control-a> [.t bind <Control-/>] When I hit Control-/ I get at the prompt "Selecting all" and all the text is selected. But when I hit Control-a all I get is the "Selecting all" at the prompt and no text is selected. I've also tried: ..t bind <Control-a> {.t tag add sel 1.0 end} And that doesn't work either. In fact, with this code if you do Control-/ and then Control-a it unselects everything. And dumping the tags for the entire region show the tagon/tagoff for sel are gone. Does anyone know the semantics of Control-/? There's got to be more to it. - Ian I've just found this thread: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/5c1df73696e94962/38ec894e32bafcd2?lnk=gst&q=select+all&rnum=8#38ec894e32bafcd2 Which seems to suggest there's nothing fancy about Control-/. - Ian And to answer my own question, the following works: bind .t <Control-a> {%W tag add sel 1.0 end; break;} - Ian On Wed, 01 Aug 2007 16:54:06 -0000, sniff.scratch@gmail.com wrote: >I'm having a difficult time binding Control-a so it selects all the >text in a w...

tktreectrl: howto select children items if a parent is selected
Hi all, I am using tktreectrl 2.2 (with wish8.4, both compiled from source) to display a 2-level tree of elements. There are 10 level 1 items and each of them has 10 children in level 2. All the items in level 1 are tagged with "level1" and all items in level 2 are tagged with "level2". I have also added a binding called SelectChildren so that if an item of level 1 is selected, then it automatically selects all of children items. This works as long as the item in level 1 is expanded but it fails if the item in the level 1 is collapsed. Does anyone know why this happens? The code is shown below. Thanks, Bala. #!/usr/bin/env wish package require treectrl treectrl .t -width 400 -height 300 -showrootbutton yes pack .t -expand yes -fill both set columnID [.t column create -text "Column 0"] ..t configure -treecolumn $columnID # create elements so that when it is selected, background is black and foreground is white ..t element create elemRec rect -outline gray -outlinewidth 1 \ -showfocus yes -fill {black {selected focus} black {selected ! focus}} ..t element create elemText text -datatype string -lines 1 \ -fill {white {selected focus} white {selected !focus}} # create styles (combine elements so that the selection is visible with black background and white foreground) ..t style create style1 ..t style elements style1 {elemRec elemText} ..t style layout style1 elemRec -union {elemText} -ipadx 4 -ipady 4 ..t style layout style1 elemText ...

Confusing behavior regarding selected text in a text widget
Greetings one and all, I am having trouble understanding how lines of text that have been "selected" in a text widget are placed in the clipboard. Here's what's happening. I have a text widget that contains only lines of text. Some of the lines are covered by a tag that makes them invisible to the user. Specifically, if ".t" is a text widget, I have defined the tag "hide_tag": .t tag configure hide_tag -elide 1 and apply it from start of line through end of line. If one then "selects" lines of text that contain these "invisible" lines and copies them to the clipboard using control-C, all selected lines show up in the clipboard, including the "invisible" ones. I understand why this is happening and, in hindsight, I should have anticipated it, but nonetheless, it is undesirable behavior and needs to be fixed in my application. I've attempted to fix this by binding a proc to the <<Copy>> virtual event and having that proc copy all selected text that is not "invisible" to the clipboard using "clipboard clear" and "clipboard append" commands. Although the proc appears to do the correct thing, i.e., excludes the "invisible" lines, nonetheless, all selected lines, even the "invisible" ones, still appear in the clipboard. Something's going on here and I don't know what it is! Can anyone help? I have attached below example code ...

selected text
Hello all Is it possible to get which text in a textarea element is selected ? If so How? Thanks Rob "Rob" <reply_@news_group.please> wrote > Is it possible to get which text in a textarea element is selected ? The function below returns any selected text (in IE, Netscape and iCab). Or if no text is selected, null is returned. You have to do additional tests to see if it is in the textarea. You should call this function onmousedown and not onclick, because that may unselect the selection. function isselect(){ if((d=document).getSelection)return d.getSelection(); ...

Selecting a text
hi, I have written a hex viewer. In that I want to mark text as selected when the user drags over the text. How can I do this? I am using this method in its simplest form, and is not working void HexView::MouseMove(wxMouseEvent &event) { if(event.m_leftDown) { wxClientDC dc(this); dc.SetTextBackground(wxColour(0x00,0xFF,0x00)); dc.SetTextForeground(wxColour(0xFF,0x00,0x00)); //dc.SetBackgroundMode(wxSOLID); dc.DrawText(wxT(" "),event.m_x,event.m_y); } } What I want to do is to draw a ' '(space character) in the clicked are...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

Select from (select)
This is a multi-part message in MIME format. ------_=_NextPart_001_01C43384.9C3B5D61 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is it possible to do a select from a select statement in Informix? Ex: Select Customer from (Select Customer, sum(invoiced_amt) as total_spent from Customers group by Customer) where total_spent > 1000 ------_=_NextPart_001_01C43384.9C3B5D61 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 6.5.6944.0"> <TITLE>Select from (select)</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P><FONT SIZE=3D2 FACE=3D"Arial">Is it possible to do a select from a = select statement in Informix?</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">Ex:</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">Select Customer from (Select Customer, = sum(invoiced_amt) as total_spent from Customers group by Customer) where = total_spent &gt; 1000</FONT></P> </BODY> </HTML> ------_=_NextPart_001_01C43...

text selection
Hello, I want to create a small bit of javascript to enable a key based selection within a text area. My users are in the habit of delineating options within anecdotal text using forward slashes, and I wanted to facilitate this more formally. I want to trap Ctrl+/ and Shift+Ctrl+/ to navigate to the next '/' character inside the text area or select that text respectively. Trapping the keystrokes was relatively easy (event.ctrlKey==1 && event.keyCode==191), but I haven't been too successful with selections. I need to support IE6 and 7 as well as FireFox. How can I exte...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

select.select()
please help me.. what does the following line do? read_sockets,write_sockets,error_sockets = select.select(CONNECTION_LIST,[],[]) In article <b8d42424-e0ab-4595-9c87-25e5c1b53349@googlegroups.com>, Bhanu Karthik <bhanukarthik2002@gmail.com> wrote: > please help me.. what does the following line do? > > read_sockets,write_sockets,error_sockets = > select.select(CONNECTION_LIST,[],[]) This is a little tricky. First,read the docs at http://docs.python.org/2/library/select.html. There's a lot of complicated stuff there, but just concentrate on the description of the select.select() call for now. Imagine a process which has a lot of network connections open. A great example would be something like a MUD (Multi User Dungeon). You've got one server process(*) and a bunch of clients which have all made TCP connections over individual sockets. Each client will be sending commands asynchronously, and the server needs to handle this. You need some way to figure out which of those sockets have something that's been sent to you (which you need to process) and which are just sitting idle. That's where select() comes in. It gives you a way to say, "Here's a list of sockets. Sleep until one of them has something available for me to read, and let me know which one." One bit of complication is that you can also check for sockets which are ready to be written on, and sockets which ...

How to set the selection-bar- and selected-text-color in a list box?
How to set the color of the selection bar and the selected text in a list box? Bart (v 2003) "AA Arens" <bartvandongen@gmail.com> wrote in message news:1140260216.140563.116330@g43g2000cwa.googlegroups.com... > How to set the color of the selection bar and the selected text in a > list box? All you can do is set the BackColor and the FontColor. Windows decides what the highlight color is based on your current Windows colors/theme. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com ...

re: Confusing behavior regarding selected text in a text widget
This message is directed to whoever replied to my original post. I read it but it was deleted before I could reply. Thank you for your reply and explanation. I knew something was going on but didn't know that the text widget class binding would be triggered. I thought that overriding the widget instance would suffice. Something to learn about. Also, thanks for your observation on my "clipboard append" call- join should be used. By the way, your suggestions did the trick! Thanks again. Mike ...

How to make selected text (a range of a text block) with red background color?
Hi, Say, I have the following block of text: " Commuters are bracing for a difficult trip around southwest Connecticut and= to New York City beginning Monday as workers repair the Metro-North commut= er rail line crippled by a derailment and crash. Crews will spend days reb= uilding 2,000 feet of track, overhead wires and signals following the colli= sion... " And I want to have an ability to let a user to select, say, "rail" and "cra= sh" with red background color, how? With Firefox and Chrome. Many thanks. Here is a basic approach to get you started (some assembly required): function highlight(node,text){ var html =3D node.innerHTML, i =3D html.indexOf(text), len =3D text.length; if(i > -1){ node.innerHTML =3D html.substring(0,i) + "<span class=3D'hightlight'>" + html.substring(i,i + len) + "</span>" + html.substring(i + len); } } var node =3D document.getElementById("foo") highlight(node,"rail") On May 19, 2:20=A0pm, justaguy <lichunshe...@gmail.com> wrote: > Hi, > > Say, I have the following block of text: > " > Commuters are bracing for a difficult trip around southwest Connecticut a= nd to New York City beginning Monday as workers repair the Metro-North comm= uterrailline crippled by a der...

current selected text to highlighted text on mouse up event through java script
hi everybody, I want to convert the current selected text to highlighted text i.e. to yellow background on mouse up event on pdf form through java script. pls help me out. Thanks in advance regards Tanmay ...

How to highlight (change background color) of selected text within a text area
I want to create a functionality to be able to highlight - change background color - of selected text in a text area. I also want to capture all of the selected text for further processing. If this is not possible in a textarea, then I use another element (like a <DIV>) basically I need to ba able to highlight multiple sections of a text and then display all of the highlighted text somewhere else. ...

Displaying text in a text box depending on selection made in list box on same form
Hi I have an unbound text box on a form from which the user can choose a product. When the user chooses a product, I want the text box on the same form to display the description of that product. right now I can get it to display the row number of the product that corresponds to what the user clicked but not the value of the Product Description which is what I want. The fields in the tables are both text. here is the code: Private Sub LstContactProducts_AfterUpdate() txtProductDescription.SetFocus txtProductDescription.Text = LstContactProducts.Column(2,txtProductDescription) End Sub Thanks in advance Colin Colin, why don't you create the combobox, with from a table or query with all the information you need and use cboComboboxname.column(0), cboComboboxname.colum(1) etc etc...to populate the fields you want? HTH Michael "Colin Ward" <cward002@sympatico.ca> wrote in message news:2a660c80.0308010710.26b3257@posting.google.com... > Hi I have an unbound text box on a form from which the user can choose > a product. When the user chooses a product, I want the text box on the > same form to display the description of that product. right now I can > get it to display the row number of the product that corresponds to > what the user clicked but not the value of the Product Description > which is what I want. The fields in the tables are both text. > > here is the code: > > Private Sub LstContactProducts_AfterUpdate() > txtP...

rectangular selections in text componets. "block column select mode".
The simple text editor programs such as MS Notepad etc allow selecting text continously with mouse which is also the case with Swing text components. More advanced text editor programs provide a special selection mode with mouse (usually activated when ALT key is pressed and held down) called "block select mode" in Textpad and "column select mode" in Ultraedit and other. The "column select" mode is about that one can mark with mouse an rectanglular region of text, that exceeds many lines of text. Is that possible in Swing with setting some kind of property ...

XSLT Select nodes without text-node children whose names starts with specifix text
Question on XSL expression Got this XML: <Body> <Page> <Line no="9" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldstext</twofield> </Line> <Line no="10" detail="true"> <onefield>onefieldstext</onefield> <fgman9>fgmanfieldstext</fgman9> <twofield>twofieldstext</twofield> </Line> <Line no="11" detail="true"> <onefield>onefieldstext</onefield> <twofield>twofieldste...

Web resources about - tktreectrl - getting text in selection - comp.lang.tcl

Tk (framework) - Wikipedia, the free encyclopedia
8.6.1 / September 20, 2013 ; 5 months ago ( 2013-09-20 ) Tk is an open source , cross-platform widget toolkit that provides a library of basic ...

Resources last updated: 3/13/2016 3:44:18 PM