I am developing a GUI in VTCL that involves drag and drop of widgets. These are 
the components in my GUI:

 *   a tree with nodes and child nodes
 *   an 'Insert' button
 *   A Separator widget
When I select a node and click on Insert,a widget should get inserted in the 
Separator.The widget can be either a button or a labelentry,having the name of 
the selected node as the text value.The purpose is that once the widget comes 
in the Separator, it should be dragable inside the Separator.
I have done the insertion part using the following code:


## Procedure:  insertElement



proc ::insertElement {} {

global widget

set sep $::widget(Separator1)

set tr $::widget(Tree1)



set sel_element [$tr selection get]

if { $sel_element != ""} {

 set lb [LabelEntry $sep[incr ::my_data::count] -label "" -text "$sel_element" \

        -relief "raised" -justify "center" -width "15" -editable "No" \

        -font {-family helvetica -size 10 -weight "bold"} \

        -dragenabled 1 -dragevent 1]

 place $lb -in $sep -x $::my_data::x_pos -y [incr ::my_data::y_pos 30]

} else {

 tk_messageBox -title "Error" -message "Please select an element" -type ok

}

if { $::my_data::y_pos > 180 } {

 incr ::my_data::x_pos 60

 set ::my_data::y_pos 0

}

if { $::my_data::x_pos > 550 } {

 set ::my_data::x_pos 50

}

}

My question is, is it possible to make the labelentry dragable? In the sense, 
can the position of the inserted labelentry be changed by simply dragging it at 
run time?


Regards,
Sriram Rajagopal
Systems Engineer |  Product Engineering
Infosys Technologles Ltd

[cid:[email protected]]


**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

<<inline: image001.jpg>>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
vtcl-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vtcl-user

Reply via email to