Re: Signals and callbacks
- From: Karl Mitchell <k l mitchell lancaster ac uk>
- To: gtk-list redhat com
- Subject: Re: Signals and callbacks
- Date: Thu, 03 Dec 1998 14:44:32 +0000
I've recently begun programming in gtk and gdk-imlib, in an attempt to write
some fast stereo-imaging algorithms with a friendly GUI. For starters, I'm
working on an display program which shows two images of the same geographic
area in a paned window, the aim being to allow extraction of tie-points
between the images for input into the automatic stereo-matching routines.
However, I've been having one or two difficulties getting to grips with a
couple of fundamentals, and I was wondering whether anyone could help.
---
Firstly, images and pixels. At present I am displaying images as pixmap
widgets within event boxes. The online documentation suggests that the pixmap
widget should only be used for smaller images: is this a matter of style or is
there some advantage?
---
Secondly, signals and callbacks. I'm trying to implement a simple zoom routine
for each image, activated whenever the event box holding the image is clicked,
at present using:
gtk_signal_connect (GTK_OBJECT (event_box_right), "button_press_event",
GTK_SIGNAL_FUNC (magnify_image), NULL);
However, the magnify_image function needs quite a lot of information passed to
it:
struct _imageData{
GdkImlibImage *image;
GtkWidget *pixmapwidget;
gint magnification_factor;
}
, and for the life of me I can't work out how to do it. I think it's something
to do with my lack of understanding of gpointers. Could anyone help me work
this one out?
Cheers,
-Karl
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]