Wednesday, March 28, 2012

Trying to find some additional information for pythonic cairo call implementations in Gtk 3+

Okay so I hadn't found through google search for gtk3+ an api for Gdk package gi.repository libraries...
or at least trying to determine pythonic implementation routines of cairo objects in gtk 3+ and am having difficulty finding translated resources from gtk 2+ to 3+, given tutorial at this site.  Notwithstanding that written information is in c fine, seems only including code snippets where c translation seems a bit formidable from text in terms of pythonic equivalents.  While other non api but tutorial site here does furnish implementation examples, it is strictly devoted to Gtk package objects...very basic stuff here and I hadn't generally found Cairo implement examples.

At this point constructed very basic module directory search of say either gtk or gdk libraries in the gi.repository.  At least running in python this can furnish function/object data pythonic calls here.

So firstly I'd mention if you are using Idle, you'd need to load the path to gi.repository...you can do this with the following lines:

import sys
a = sys.path
a.append('/usr/lib/python2.7/dist-packages')

or from your terminal launching python the usual way ($python) normally if you have something like quickly installed, the path above should by default be installed.

Similarly if you need to load the path any module, you can add this using the method above with your path assigned.


from gi.repository import Gtk
from gi.repository import Gdk

def searchword(word):

    def findresult(searchlist):
        results = []
        for item in searchlist:
           if word in item:
               results.append(item)
        return results      
       
    resultsa = []
    resultsb = []
    a = dir(Gtk)
    b = dir(Gdk)
    asearch = findresult(a)
    bsearch = findresult(b)
    return asearch, bsearch



So this particular code, allows for a search of the Gtk, and Gdk directories...

this may give some additional python translated calls for utilising these libraries.


No comments:

Post a Comment

Oblivion

 Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...