Re: gtk programming
- From: Hadron <hadronquark@xxxxxxxxx>
- Date: Mon, 25 Dec 2006 23:28:23 +0100
gaetanoortisi@xxxxxxxx writes:
Hello,
I've started programming with gtk libs, and I have few questions about
them:
1. Looking at Pango reference manual, I found a useful function named
pango_parse_markup(). How is possible to use this to draw text with
attributes together with GtkTextBuffer and GtkTextView?
2. Are there widgets that display media contents, or how can I use
current
widgets to play a video with a player (as mplayer, or xine, for
example)?
3. Suppose I have to make a drawing area in which the cursor
must change when entered. Look at this code:
GtkWidget *dr = gtk_drawing_area_new();
gtk_widget_add_events(dr, GDK_BUTTON_PRESS_MASK);
gtk_widget_set_size_request(dr, width, height);
g_signal_connect(dr, "expose_event", G_CALLBACK(expose_callback),
NULL);
g_signal_connect(dr, "button_press_event",
G_CALLBACK(mouse_pressed), NULL);
gdk_window_set_cursor(dr->window, gdk_cursor_new(GDK_PENCIL));
However, when I run it I receive this objection:
Gdk-CRITICAL **: gdk_window_set_cursor: assertion `GDK_IS_WINDOW
(window)' failed
If I put gdk_window_set_cursor in the expose_callback() it works,
but I don't know
if it is needed or is a *bad* way.
Another problem: if I have multiple pixbufs to be over a drawing
area, there is
a way to draw them over only a pixbuf and repaint only it at expose
events or I
have to redraw all of them (in other words: can I use gdk-pixbuf or
another widget
as a offscreen drawable?)
Thanks,
Gaetano
I'm afraid I can not help directly, but be aware of the nabble forums
and the gtk mailing lists.
http://www.nabble.com/Gtk%2B-f1329.html
http://www.gtk.org/mailinglists.html
Good luck.
.
- References:
- gtk programming
- From: gaetanoortisi
- gtk programming
- Prev by Date: gtk programming
- Next by Date: Anjuta : is it an ok begginner's IDE?
- Previous by thread: gtk programming
- Next by thread: Anjuta : is it an ok begginner's IDE?
- Index(es):