Re: Replacement for pygtk?

2020-09-06 Thread Liste guru

Il 06/09/2020 06:20, Michael Torrie ha scritto:

On 9/4/20 3:24 PM, Grant Edwards wrote:

I assume that difference is because pygtk was hand-written and gi is
built auto-magically using SWIG or something like that?

Essentially, yes.  Although pygobject does not use a tool like swig to
generate static wrappers. Rather it uses the GTK introspection API to
ask gobject's for their methods and attributes, and then marshalls and
calls them at runtime. So you can use pygobject with any GObject-based
binary library, not just GTK+.  Hope that makes sense.


    AFAIK, from the source code / include files a .gir file is 
generated (an xml with all the functions, parameters and info).


    For example for a simple rectangle_int(x. y. width, height) in 
cairo you have:


    
  
    
  
  
    
  
  
    
  
  
    
  
    

    From this file a .typelib is generated (a binary, compact 
representation of the data) and the gi library, using this file and the 
.dll/.so, creates the correct bindings and function for the language you 
use (at runtime).


    Switching from Gtk 3.22 to Gtk 3.24 (or a new 3.26) is only a 
matter of using the new .typelib/.dll with your version of gi, at least 
until the gi folks puts the handling of the default values for parameters :)


    So with the gi package for your python (say 3.5.10) you can use all 
the Gtk versions, you don't have to recompile for example Gtk 3.24.13 
for your python/gi version.


    To have all the Gtk works with python 3.8 you have only to port / 
build the gi part (and on windows make some magic to handle the new path 
handling for the .dll search/load location, but this is another story).


    With best regards

        Daniele Forghieri




--
https://mail.python.org/mailman/listinfo/python-list


Re: Need to 'import gtk' on Ubuntu 20.04, what do I need?

2020-07-25 Thread Liste guru

Il 24/07/2020 10:31, Chris Green ha scritto:


   ...

I'm a *fairly* competant Python programmer so, if I have to, I 
willconsider converting from using the gtk module to using the gi 
module,are there any good tutorials which might help me down this road?



   If you look at the pygobject documentation there is a chapter (and a 
script, similar to 2to3) to help the migration: 
https://pygobject.readthedocs.io/en/latest/guide/porting.html


--
https://mail.python.org/mailman/listinfo/python-list


Re: What's up with Activestate Python?

2019-02-14 Thread Liste guru

Il 14/02/2019 00:06, Grant Edwards ha scritto:

For many, many years I've always installed ActiveState's ActivePython
Community edition when forced to use Windows.  It has always included
...
I guess it's time to switch to Anaconda or ???



    I've also used the ActiveState python, expecially for the 2.7.x 
series, mainly for the oflline docs and the pywin32 libraries.


    Now the situation is better and with pip is really easy to have an 
updated python with a lot of libs so there is less need for the 
ActiveState distribution.


    My 2 cent.

    Daniele Forghieri





--
https://mail.python.org/mailman/listinfo/python-list


Re: Python Interpreters In Eclipse

2018-11-16 Thread Liste guru

Il 16/11/2018 21:08, Jaxson Baerg ha scritto:

Hey, I'm attempting to use python in eclipse and am having trouble with the
python interpreter. I am using Eclipse 2018-09 and the latest PyDev and
Python 3.7.1. When declaring python-3.7.1.exe as an interpreter it gives an
error saying it was unable to get info on the interpreter. It also says a
possibility to why could be using an unsupported version. I don't know
where to go from here, another piece of information is that I am doing this
on a school computer with teacher permission but I don't know if that could
be causing an issue or not? Any help would be appreciated, thanks!


    When setting a pydev interpreter for the standard Pyrthon you 
should point it to a file named python.exe (I suppose you are on 
windows) on an installed (or virtualenved) python, so probabably you 
just have to install it on windows , launching (outside eclipse) the 
python-3.7.1.exe and following the instruction.


    With best regards

    Daniele Forghieri


--
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Liste guru

Il 30/07/2018 19:31, Chris Green ha scritto:


OK, thanks, where is its home and full API documentation etc.?
-- Chris Green·-- https://mail.python.org/mailman/listinfo/python-list


On the first page of the official docs, 
http://pygobject.readthedocs.io/en/latest/, there are the links to the 
Python Gtk3 Tutorial, to the Python GI API Reference and all you need to 
start to work with Pygobject and Gtk3.


Just a side note: Gtk3 uses the gobject-introspection (and, for Python, 
PyGobect) to 'connect' the library to Python (or with Lua or Vala) but 
the same introspection system is used also for different library, 
graphical (GStreamer or Goocanvas) or not (Gio).


    Daniele Forghieri

--
https://mail.python.org/mailman/listinfo/python-list


Re: Suggestion for a "data" object syntax

2018-05-08 Thread Liste guru

Il 08/05/2018 14:52, Mikhail V ha scritto:

 ...

What editor do you use? My editor can toggle tabs highlighting as arrows,
and I suppose almost any editor has good support for highlighting of
characters by search, etc. For NPP there are even plugins like Regex helper.


    I like to 'type program.py' and understand what's happening, 
without have to fire up an editor.


   While, in C++, the Microsoft IDE (and some other) mark the class 
members & the parameters so you can easily see what 'counter' is, a lot 
of guide says that you should call it 'm_counter' if it's a member or 
'counter_' if it's a parameter, just in case you don't have your editor 
(or you're colorblind or you don't like to have the parameters printed 
with a light grey ...).



   ...
--
https://mail.python.org/mailman/listinfo/python-list


Re: Where to find python GTK+ 3 reference documentation?

2017-03-10 Thread Liste guru

Il 10/03/2017 20:26, Wildman via Python-list ha scritto:

On Fri, 10 Mar 2017 18:51:35 +, Chris Green wrote:


I'm using the excellent tutorial at https://python-gtk-3-tutorial.readthedocs.io
and occasionally want reference documentation, is there reference
documentation for this on line?

https://developer.gnome.org/gtk3/

If you get the pygobject package from sourceforge, in the various 
packages there is devhelp with the documentation of all the libs (and 
many more, if I'm not wrong there is also the python doc installed), 
with particular section about python.


As a reference I found it very useful.

Daniele Forghieri


--
https://mail.python.org/mailman/listinfo/python-list