How to port a GTK project to Win32 platform?

2006-08-15 Thread heavenscape
Hi all, I see some documentations of Gtk and Gnome are saying that the GTK and Gnome projects can be ported to win32 platform. I'd like to know how, and how can I get the related libraries and environments available under MS windows XP. Thank you!! Mason -- View this message in context: http:

funny gettimeofday

2006-07-22 Thread heavenscape
I have following code: gettimeofday(&tv1,NULL); // do something here gettimeofday(&tv2,NULL); printf("Elapsed time is: %d seconds\n", tv2.tv_sec-tv1.tv_sec); /// each time I get the following outcome: Elapsed time is: -114016690

cannot draw lines in a GtkDrawingArea widget

2006-06-21 Thread heavenscape
Hi all, I need to draw some lines in a GtkDrawingArea widget, and I use the following code: GtkWidget* w = lookup_widget(MainWnd,"drawingarea1"); gdk_draw_line(w->window, // a GdkDrawable - a GdkWindow w->style->fg_gc[GTK_WIDGET_STATE (w)],// a GdkGC. 10,//the x

How to capture the scroll event of the scrolled window?

2006-06-20 Thread heavenscape
I need to track the scroll events of the GtkScrolledWindow, and i use following code: GtkWidget* w = lookup_widget(MainWnd,"scrolledwindow1"); gtk_widget_add_events (w, GDK_SCROLL_MASK); and I mapped the scroll child event with glade, but it does not work. Anyone knows why? -- V

trouble getting the current size of GtkViewport

2006-06-19 Thread heavenscape
I am displaying an image inside a GtkViewport (which is in a scrolled window), my main window resizes frequently (and so the viewport), and i want the image to rescale to fit the current size of the viewport. Anybody has any idea how to get the current size of the viewport? Thanks a lot -- V

Trouble with GtkImage on button press event!

2006-06-19 Thread heavenscape
I need to capture the button press event on a GtkImage widget, and I use the following code: w = lookup_widget(MainWnd,"image1"); gtk_widget_add_events(w, GDK_BUTTON_PRESS_MASK ); and I mapped the "Button press event" using glade, but it never worked. Anyone knows why? -- View

How to capture the mouse move and double click event?

2006-06-19 Thread heavenscape
I have a GtkImage in a GtkViewport, when the mouse is hoving above the image, I need to capture the coordination of the cursor. In VC++, this can be easily achieved by using the OnMouseMove() function. But in Gtk, I cannot find any similar signal to map. Does anyone got any idea? Thanks!! -- Vie

Is there any widget on which I can plot my own primitives?

2006-06-19 Thread heavenscape
I have explored some widgets such as GtkImage and GnomeCanvas, but none of them provide the functions I need. Does anyone got any idea? Thanks! -- View this message in context: http://www.nabble.com/Is-there-any-widget-on-which-I-can-plot-my-own-primitives--t1810109.html#a4932993 Sent from the

How to draw a rectangle on a GtkImage widget?

2006-06-18 Thread heavenscape
Hi All, I am displaying an image in the main window with a thumbnail of the same image on one side. The thumbnail always shows the entire image while the main window shows just a part of the image because of zoom. Now I want to draw a rectange in the thumbnail to indicate which part of the image

Re: Thread-generated signals

2006-06-02 Thread heavenscape
Yes! My background thread will send a message when it has finished something, so I do need the check the message status frequently. If my OnIdle function return false, it will never be called again, and therefore cannot monitor the message status any more. Is there any alternate solution? Than

Re: Thread-generated signals

2006-06-02 Thread heavenscape
Hi Michael, I am a beginner in Linux programming, and your suggestion works! But I am still having some problem that the CPU usage is always 100% after the program starts. Could you please look at my code below and give me some suggestion? Thanks a lot!!! Following is some of my code: // id

Re: Help with GdkPIxbuf and GtkImage...

2006-06-01 Thread heavenscape
Maybe I am having the same question as you do. I am trying to display a 24bit image with size 2048X2048 pixels, and following is my code: //create a GdkPixbuf GdkPixbuf* pb = gdk_pixbuf_new_from_data( pDisplayBuf, // data buffer GDK_COLORSPACE_RGB, //COLORSPACE