HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Callbacks and GUI
Author: Abel Deuring
Date: 09/20/2004 13:42
 
> The httrack-py wrapper looks rather good.  

Thanks ;)

> Perhaps I should start learning Python :)

Python is quite easy to learn. For a quick start, have a
look into the Python tutorial:
<http://docs.python.org/tut/tut.html>.

> I'm not really a programmer per se, so excuse my ignorance, 
> but would something like callbacks allow construction of a 
> GUI to control Httrack?
I don't think so. (why? see below)

> I'm trying to get my head about the concept. A callback 
> wrapper is written which HTTrack is then instructed to use, 
> so that various functions within HTTrack can be given 
> extended control and functionality through the callbacks?
Exactly. Most of the callbacks are issued, while an HTML
page is analyzed or while links are checked if they should
be included in the mirror. In other words, it's pretty 
low level stuff, where you can do fancy things with a 
single link or page. An exception are the callbacks start,
change-options, which give access to the parameters
controlling the behaviour of httrack. But httrack already 
has a GUI (at least for Windows), wher you can set the
parameters.

> If that's the case, I don't really see how a GUI might be 
> executed and then made to start and control and instance of 
> HTTrack with feedback returned to the GUI.

Right. It is not easy to tie the callbacks to a GUI or even
to configure their behaviour with a GUI. There are 
generally two options: 

1. create a completely "autonomous" program that has a GUI 
allowing to set the various parameters for httrack. When
a "start mirror" button is clicked, the command line
version of httrack is executed, it's output is read by
the GUI program and displayed in some fancy way. This way
work many GUIs for GnuPG. 

2. Most of httrack's functionality is in a shared library / 
DLL, hence you could write a GUI program that links this
library. I never thought about that when I wrote httrack-py,
(I'm more a fan of command line programs, and httrack-py is 
the proverbial scratching-an-itch project), but looking 
into libtest/example.c of the httrack sources, it seems
to be worth a try to add some "python glue" for hts_init
and hts_main to httrack-py. Combined with a GUI toolkit 
for Python like Tk or wxWindows, it should not be too
difficult to write a custom GUI for httrack.

> I may be looking at things backwards, not sure, just thought 
> I'd ask and get an idea of how insane I'd need to be to 
> write a new GUI ;)

Well, that depends ;) If you don't have much programming 
experience, I'd recommend to start with some command line 
stuff, (specifically, the simple callbacks in this case), 
because GUIs are relatively complex, and it is not a good
idea to fight on more that one front, i.e. to learn a
programming language and to understand all the details of
a GUI toolkit like window layout, implementing callbacks
for things like mouse clicks etc.

Abel
 
Reply Create subthread


All articles

Subject Author Date
Callbacks and GUI

09/20/2004 02:17
Re: Callbacks and GUI

09/20/2004 13:42
Re: Callbacks and GUI

09/21/2004 01:12
Re: Callbacks and GUI

09/23/2004 03:58
Re: Callbacks and GUI

10/02/2004 16:34




1

Created with FORUM 2.0.11