The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hi all,
Is it possible to bind mouse button operations on hwtk treectrl widget?
For example I have created a tree like below, when i click on any item, it should act as a button and execute some command.
Hi Vipin
did you try setting a callback for option -selectcommand when creating the treectrl ?
when you select some thing it will invoke -selectcommand
Hi @tinh
I added -selectcommand as you said.
Anything I select in the tree it is running that command, but how do I assign different script/command for each of the buttons?
example
set t [hwtk::treectrl $treewnd -selectcommand 'p_AtSelected %W']
proc p_AtSelected t {
set items [$t select]
#you may select more than 1 item so pls handle it
foreach item $items {
set text [$t item text $item 0]
switch -- $text {
button1 {
...
}
button2 {
... ...
Hey tinh,
Thanks a lot for the help. It is working perfectly!!
I Added -selectmode single, so multiple selection solved /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
can u share me this macros
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…