Top/bottom margins for GtkTextView ?

2008-03-03 Thread Miroslav Rajcic
Is there a way to set the top and bottom margins for text within the 
GtkTextView ?

I've noticed there are methods to set the left and right margins, but not the 
ones for top and bottom.

Regards,
  Miroslav
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


答复: Please help: How to embed a X wind ow in a GTK window?

2008-03-03 Thread Ke Jin
Hi Bin,
  Thanks for the reply. I am new to GTK and could you please explain it in
more details?

Thanks,
Kay

-邮件原件-
发件人: Bin Chen [mailto:[EMAIL PROTECTED] 
发送时间: 2008年3月2日 7:33
收件人: Ke Jin
抄送: gtk-app-devel-list@gnome.org
主题: Re: Please help: How to embed a X window in a GTK window?

On 3/2/08, Ke Jin [EMAIL PROTECTED] wrote:
 Dear All,
 I am working on a project whose code was written in Xlib and now I
 need to develop a GUI for it. I want to use GTK so I wonder if I could
 embed the former xlib window into a GTK top-level window. I wrote a
 small test program as below but it doesn't work. Does anyone have any
 idea about how this is gonna work?

 #include string.h
 #include X11/Xlib.h
 #include X11/keysym.h
 #include gtk/gtk.h
 #include gdk/gdkx.h
 #include stdlib.h
 #include stdio.h
 #include sys/types.h

 void destroy (GtkWidget *widget, gpointer *data)
 {
 gtk_main_quit ();
 }



 int main(int argc, char* argv[])
 {
 Display* display = XOpenDisplay(NULL);
 int screen = DefaultScreen(display);
 int width = DisplayWidth(display, screen)/6;
 int height = DisplayHeight(display, screen)/6;
 GtkWidget *gtkWin;
 XEvent e;
 pid_t pid;
 Bool child = FALSE;
 int timer = 0;

 gtk_init (argc, argv);

 gtkWin = gtk_window_new(GTK_WINDOW_TOPLEVEL);

 gtk_signal_connect(GTK_OBJECT(gtkWin),
 destroy,GTK_SIGNAL_FUNC(destroy),NULL);

 gtk_widget_realize(gtkWin);

 Window win = XCreateSimpleWindow(display, RootWindow(display,
 screen),
 0, 0, width, height, 3, BlackPixel(display, screen),
 WhitePixel(display, screen));
 XStoreName(display, win, hello);
 GC gc = XCreateGC(display, win, 0, NULL);

I don't think this way can work. To embed a X window in Gtk window, I
think you must handle the redraw event of the X window and manually
copy the drawables to the Gtk+ window.


Bin

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

A question about GtkStyle

2008-03-03 Thread zfei
Dear all:
I am a new user of gtk.I have a question about GtkStyle! As we konw the
GtkStyle  of a GtkWidget determine that how the widget to be drawn,that
is to say the GtkStyle determine the  appearance of a widget! But when
the GtkStyle of a widget is been created.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


OpenGL, GtkGlArea, GtkGLExt

2008-03-03 Thread Carlos Pereira
Hi,
What is the currently recommended way to link GTK with OpenGL graphic 
areas? GtkGLarea? GtkGLext? other?

What are the future plans for GTK regarding OpenGL? is GTK planning to 
support OpenGL directly without need for another library? I am not 
particularly interested in fancy arbitrary widget rendering with OpenGL, 
only rendering to graphic drawing areas,

Best regards,
Carlos
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: OpenGL, GtkGlArea, GtkGLExt

2008-03-03 Thread Mikael Hallendal
3 mar 2008 kl. 22.48 skrev Carlos Pereira:

Hi Carlos,

GtkGLext seems to be the most popular GL Area to use these days. You  
might also want to look at Clutter [1] or Pigment [2] which are  
canvases offering some higher level abstractions for 2D/3D usages. It  
depends a bit on what you need, if you just want an area for pure GL  
I'd go with GtkGLext.

Regarding future inclusion of GL in GTK+ there is an open bug about it  
in the Bugzilla [3], I started looking into it a while back but didn't  
have time to get anything off my hard drive. There are some open  
issues in that you can read about in the bug tracker.

Good luck,
   Mikael Hallendal

[1] http://www.clutter-project.org/
[2] https://code.fluendo.com/pigment/trac
[3] http://bugzilla.gnome.org/show_bug.cgi?id=119189

 Hi,
 What is the currently recommended way to link GTK with OpenGL graphic
 areas? GtkGLarea? GtkGLext? other?

 What are the future plans for GTK regarding OpenGL? is GTK planning to
 support OpenGL directly without need for another library? I am not
 particularly interested in fancy arbitrary widget rendering with  
 OpenGL,
 only rendering to graphic drawing areas,

 Best regards,
 Carlos
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
Imendio AB, http://www.imendio.com




___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Problem on gdk_window_shape_combine_mask and gtk_timeout

2008-03-03 Thread Magicloud Magiclouds
Hello,
I use gdk_window_shape_combine_mask in gtk_timeout timer, to change my 
window's shape every second.
While I first use gdk_window_shape_combine_mask without timer, it 
works. Then put it in the timer, the application crashed, with message:

The program 'crazyclock.rb' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
   (Details: serial 181 error_code 8 request_code 128 minor_code 2)
   (Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() 
function.)

Could someone help me out?

Thanks.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list