I think you need to handle it in your Tcl code, not in loadbang. basically, like what the pdwindow does if it receives log messages before the window is done creating. If the window has not received the <<Loaded>> event, store the tooltip draw commands in a variable. Then once it does receive the <<Loaded>> event, run any stored commands, and stop storing any new ones.
But maybe there is a better approach? You might just try doing in Tcl:
after idle draw_my_tooltip
Basically, that waits for the current Tk event loop to complete.
.hc
On Oct 10, 2011, at 9:22 PM, Jonathan Wilkes wrote:
Thanks, Hans. But then how would I override the normal
loadbang behavior for that one particular canvas method?
-Jonathan
----- Original Message -----
From: Hans-Christoph Steiner hans@at.or.at To: Jonathan Wilkes jancsika@yahoo.com Cc: "pd-dev@iem.at" pd-dev@iem.at Sent: Monday, October 10, 2011 2:25 PM Subject: Re: [PD-dev] loadbang and sys_vgui
You could try listening for the <<Loaded>> event. That gets sent once the GUI is done loading a patch. Its from. ::pdtk_canvas::finished_loading_file.
.hc
On Oct 9, 2011, at 11:45 PM, Jonathan Wilkes wrote:
Hi, I've run into an issue with my tooltips when using manual mode:
[loadbang] | [tip 1 hello( | [s foo]
[namecanvas foo] This creates a window with a label that has the text "hello".
But when loadbang'd the label is set too narrow. The text displayed
like this:
h e l l o
In testing I found I have to use a [del 200] to get the text to display
correctly.
Seems like the dimensions of the patch window aren't fully set at
loadbang time.
Any advice on a way to make it display correctly when loadbang'd?
Patch is at:
https://sourceforge.net/tracker/?func=detail&aid=3383472&group_id=55...
-Jonathan
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
kill your television
----------------------------------------------------------------------------
"It is convenient to imagine a power beyond us because that means we don't have to examine our own lives.", from "The Idols of Environmentalism", by Curtis White