Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

incomplete window capturing (set image [image create photo -format "window" -data "$pWidget"])

116 views
Skip to first unread message

lem...@gmail.com

unread,
May 27, 2016, 12:07:23 PM5/27/16
to
Hi,

I need to make snapshot of widget in order to fgenerate some documentation in my tool. After some research the Img::window package seems to be (almost) perfect.

The problem is i mostly have incomplete image generation, even if the widget is visible.

I "topmost" the toplevel window, i raise it, i raise the specific widget, i update before createing the photo. The first time, it works, but after that it does not :(

Is there known bugs (i'm using the 1.4.3 version of Img package and tcl 8.5.18).

Thanks,
Jérôme Legrand

Brad Lanam

unread,
May 27, 2016, 3:53:25 PM5/27/16
to
Wouldn't a standard system snapshot tool work out better? The linux flavors all have some sort of 'screenshot' tool, Windows has their snipping tool.

Jerome Legrand

unread,
Jun 3, 2016, 3:49:20 AM6/3/16
to
It is a possibility but it would much more complex that the the simple code to grab the widget image and it would not have the same possibility : i switch between widget in order to produce image for an automatically generated documentation. I m not sure i can do the same with an external tool.

Brad Lanam

unread,
Jun 3, 2016, 5:07:19 PM6/3/16
to
On Friday, June 3, 2016 at 12:49:20 AM UTC-7, Jerome Legrand wrote:
> Le vendredi 27 mai 2016 21:53:25 UTC+2, Brad Lanam a écrit :
> > On Friday, May 27, 2016 at 9:07:23 AM UTC-7, Jerome Legrand wrote:
> > > Hi,
> > >
> > > I need to make snapshot of widget in order to fgenerate some documentation in my tool. After some research the Img::window package seems to be (almost) perfect.
> > >
> > > The problem is i mostly have incomplete image generation, even if the widget is visible.
> > >
> > > I "topmost" the toplevel window, i raise it, i raise the specific widget, i update before createing the photo. The first time, it works, but after that it does not :(
> > >
> > > Is there known bugs (i'm using the 1.4.3 version of Img package and tcl 8.5.18).
> > >


> > Wouldn't a standard system snapshot tool work out better? The linux flavors all have some sort of 'screenshot' tool, Windows has their snipping tool.
>
> It is a possibility but it would much more complex that the the simple code to grab the widget image and it would not have the same possibility : i switch between widget in order to produce image for an automatically generated documentation. I m not sure i can do the same with an external tool.


Right. For automatically generated documentation, an external tool would be difficult. Unfortunately, I'm not using that part of the Img package, so can't help with that. You'll have to see if anyone else is familiar with it.

rene

unread,
Jun 6, 2016, 6:06:06 AM6/6/16
to
A little bit offtopic but I regularly use "rbc::winop snap" to create live images under windows.

For docu I use the following proc. Activate it with "snapwidget on" and then get the image with F12.

proc snapwidget {mode} {
switch -- $mode {
on {
bind all <Enter> {set ::ztk::snapwidget %W}
bind all <Key-F12> {::ztk::snapwidget do}
}
off {
bind all <Key-F12> {}
}
do {
if {![winfo exists $::ztk::snapwidget]} return
catch {image delete __snap}
catch {destroy .__snap}
image create photo __snap
::rbc::winop snap $::ztk::snapwidget __snap
toplevel .__snap
wm overrideredirect .__snap 1
wm geometry .__snap +100+1
bind .__snap <Key-Delete> {destroy .__snap}
::grid [::label .__snap.l -image __snap]
wm deiconify .__snap
}
}
}


HTH
rene

Jerome Legrand

unread,
Jun 7, 2016, 9:11:42 AM6/7/16
to
Le lundi 6 juin 2016 12:06:06 UTC+2, rene a écrit :
> A little bit offtopic but I regularly use "rbc::winop snap" to create live images under windows.
>

Yes i've seen the blt package but of course it is not compatible with tcl 8.5 or 8.6 :(

Tim Wallace

unread,
Jun 7, 2016, 9:22:44 AM6/7/16
to
That's why you could consider rbc: contains the essentials of blt and
*is* compatible with 8.5/8.6...

Jerome Legrand

unread,
Jun 13, 2016, 9:11:46 AM6/13/16
to
ok thanks i will look into it
0 new messages