Sorry, I said stupid things in my previous message...

There is a better way to use popups.

- Suppose the widget with the context menu is a toplevel (but it can be a
frame, or a button, etc.)

- Open the command console

- Type:
menu .top53.rMouse

(supposing that .top53 is the toplevel with the ButtonRelease-3 binding).

- Then type:
vTcl:widget:register_widget .top53.rMouse

- Refresh the widget tree, you should now see the menu item, and you can
edit it from the attributes editor

- In your binding, just add:
tk_popup %W.rmouse %X %Y

- Save your project. The menu is now part of your project.

CG

"RJ Ent." wrote:

> Greetings,
>
> I am curious how to correctly use tk_popup with VTcl-1.5.2.  Below is
> the general form of code that I use for a ButtonRelease-3 bind to create
> a popup menu (I am using the binding interface in VTcl):
>
> if {[winfo exists .rMouse]} {
>         destroy .rMouse
>     }
> menu .rMouse
> .rMouse add command -label "Text you want here."
> tk_popup .rMouse %X %Y
>
> This works fine in the apps when ran standalone, but if I use this with
> a binding and run it under Test mode in VTcl, I get a namespace error
> the next time I try to save.
>
> I do not think this is a bug in VTcl. I think it is my method of coding
> that could be the problem.
>
> Thoughts welcome on how to resolve and many thanks!
>
> --
> RJEnt - Webmail
> RJEnt - http://www.rjent.pair.com
> Solutions provided with FreeBSD - http://www.freebsd.com
>
> _______________________________________________
> vtcl-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/vtcl-user


_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user

Reply via email to