[Gambas-user] webtree select from code

BB adamnt42 at gmail.com
Fri Nov 11 21:05:56 CET 2022


On 12/11/22 4:33 am, Marco Ancillotti wrote:
> Hi all ,
>
> I'm using gb.web.gui webtree but I don't find a way to select the 
> first item from code.
>
> When I do webtree.movefirst first item is not selected , I search but 
> don't find a way to do that ,
> where is the trick ?
>
> thank's in advance ,
> marco.
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

I presume that you are trying to select a node as if the user clicked on it.

The trick is to read _every word_ of the help page. WebTree.MoveFirst 
moves the index of the *internal cursor*. It does nothing about the 
"selection" on the screen. What you want is to find a particular node, 
which is a *_WebTreeItem*, and set its *Selected* property. I note that 
the help page for the _WebTreeItem hasn't been written yet but we can 
assume that it is the same as the TreeView._TreeItem property. So 
research that page 
<https://gambaswiki.org/wiki/comp/gb.qt4/_treeview_item>.

b

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221112/6356cf18/attachment.htm>


More information about the User mailing list