logo       


Re: Tutorial for porting from Gtk-Perl to Gtk2-Perl: msg#00076

Subject: Re: Tutorial for porting from Gtk-Perl to Gtk2-Perl
Guillaume Cottenceau <gc@xxxxxxxxxxxxxxxx> writes:

> > Guillaume has a document that can help in the CVS:
> 
> It'd be interesting that all the people who port programs do add
> things to this document, when they miss. Sending to this list
> would be ok too.

i ported most mandrake config tools[1] as well as mandrake control center
to Gtk+2.

i put trivial changes into a script so that basic conversion would be
automatic and that i've basically "only" to convert CTree, CList and
Text widgets and the like.

here it's (publically availlable in mandrakesoft cvs, in gi/docs
module) :

Attachment: porting-ugtk
Description: Text document

it lacks some emacs macros i used to convert to pixel & guillaume oo
style (thais "method object" become "object->method"), and the like.
in fact, it's just the immediate required change i had to do; most
complex were not so trivial and it would have been dangerous to
automate them.

part of this script will be useless for most people since we writed a
layer on top of gtk (ugtk) to simplify gtk+ code and be able to do
"functionnal" programming when we build a gui, which is much more
powerful and simpler.

eg, here's the extracted code from harddrake that create its gui
(well, there's of course more complicated code to detect hardware and
fill the hw tree) :

Attachment: harddrake2-gui
Description: Text document

that is 30 lines of code whereas glade-2 generate 673 lines just to
create a similar gui ...


for what's left, CTree/CList conversion is quite trivial with
 ->append_set helper. basically, you just have to create the model
before, freeze the model rather than the tree, and the like.

TextView conversion is not that much complex, though it's usually
simpler to just add all text in one pass rather than multiples times
with such a wrapper (extracted from ugtk) :

Attachment: gtktext_insert
Description: Text document

that also prevent you from freezing and de-freezing the widget which i
don't know how to do.

[1] that is drakxtools, not other softs such as rpmdrake which was
    converted by guillaume
Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe