one pixel=how many mm?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

one pixel=how many mm?

luofeiyu
in tkinter ,you can express  width in cm ,mm,inch,,pixel
i want to know:
 one pixel=how many mm?

_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss
Reply | Threaded
Open this post in threaded view
|

Re: one pixel=how many mm?

Martin B.-4
V Sun, 28 Aug 2011 10:10:30 +0800
"守株待兔" <[hidden email]> napsáno:

> in tkinter ,you can express  width in cm ,mm,inch,,pixel
> i want to know:
>  one pixel=how many mm?
 
pixels per mm   = root.winfo_fpixels('1m')
pixels per point = root.winfo_fpixels('1p')
pixels per inch   = root.winfo_fpixels('1i')
pixels per cm     = root.winfo_fpixels('1c')
_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss
Reply | Threaded
Open this post in threaded view
|

GUI response

Martin B.-4
In reply to this post by luofeiyu
Hi all,
I want to know is my solution is 'clean'.
I need good gui response if cpu is very busy. in this example cpu is
compute my photo images on to low res.

in next step i need compute md5 sums for each image etc.
Is it good solution write all gui class as Thread or better way is
write only critical cpu code into thread  like md5 checksums, resizing
etc.

in this example i want use slider if cpu is computing, which is work.
thanks for your comments.
_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss

viewer.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GUI response

Martin B.-4
V Thu, 1 Sep 2011 11:18:10 +0200
Martin B <[hidden email]> napsáno:

wrong path, I'm sorry.

> Hi all,
> I want to know is my solution is 'clean'.
> I need good gui response if cpu is very busy. in this example cpu is
> compute my photo images on to low res.
>
> in next step i need compute md5 sums for each image etc.
> Is it good solution write all gui class as Thread or better way is
> write only critical cpu code into thread  like md5 checksums, resizing
> etc.
>
> in this example i want use slider if cpu is computing, which is work.
> thanks for your comments.
_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss
Reply | Threaded
Open this post in threaded view
|

Re: GUI response

Michael Lange
In reply to this post by Martin B.-4
Hi,

Thus spoketh Martin B <[hidden email]>
unto us on Thu, 1 Sep 2011 11:18:10 +0200:

> Hi all,
> I want to know is my solution is 'clean'.
> I need good gui response if cpu is very busy. in this example cpu is
> compute my photo images on to low res.
>
> in next step i need compute md5 sums for each image etc.
> Is it good solution write all gui class as Thread or better way is
> write only critical cpu code into thread  like md5 checksums, resizing
> etc.
>
> in this example i want use slider if cpu is computing, which is work.
> thanks for your comments.

One thing you should *never* do is to try to handle the gui from a child
thread. The Tk gui should always be run from the main program thread and
communication between the gui and child threads can be done through a
lock like a threading.RLock() or a threading.Condition() ; these allow
you to safely update some variables from within the child thread and then
query this variables' values from the gui thread (typically with an after
() loop).

The odd thing about gui and threads is, that it might *seem* to work when
you touch your gui from the child thread, but weird, unreproducable
things may happen.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

        "We have the right to survive!"
        "Not by killing others."
                -- Deela and Kirk, "Wink of An Eye", stardate 5710.5
_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss