Re: whats the purpose of quark

2008-01-23 Thread Binary Chen
在 2008-01-23三的 22:09 -0500,Matthias Clasen写道:
> On Jan 23, 2008 9:54 PM, Bin Chen <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > In glib there is a primitive named quark, it relates a ID with a
> > string, but whats the advantage for this? Can we use a string instead,
> > just to save some bytes for duplicated strings?
> 
> It has the same advantages as string interning in any other
> language...

Can you give me an example for this?

Bin

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

gtk im switch

2008-01-02 Thread Binary Chen
Hi,

I have a GTK IM input method, the regular way to use it is right-click
the text window, and select the input method.

But if there is anyway other than this to select the desired GTK input
method? I mean can I use a hot-key to activate the desired IM module?

I can change the code to apply the modification, please comments,
thanks.

Bin

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



Re: Can I make a not aligned gtk treeview?

2007-12-17 Thread Binary Chen
Hi Michael,

Finally I solved the problem by this way!

Thanks.
Bin

On Mon, 2007-12-17 at 11:44 +0100, Mikael Hallendal wrote:
> 17 dec 2007 kl. 08.29 skrev Binary Chen:
> 
> Hi,
> 
> A TreeView will always align the columns. However, to achieve the  
> behavior you look for you can pack two cell renderers into the same  
> column.
> 
> Cheers,
>Mikael Hallendal
> 
> > Hi,
> >
> > I have a gtktreeview with two column, the first one is pixbuf, the
> > second one is a string. something happen bad if in a row the first
> > pixbuf is NULL, so it doesn't occupy any place, but in the following  
> > row
> > there is a pixbuf and occupy some place. the default behavior of
> > gtktreeview will align the second column so leave a large blank in  
> > first
> > row.
> >
> > How can I tell treeview not align in different row, but just place the
> > column independently?
> >
> > Thanks.
> > Bin
> >
> > ___
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 

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


Can I make a not aligned gtk treeview?

2007-12-16 Thread Binary Chen
Hi,

I have a gtktreeview with two column, the first one is pixbuf, the
second one is a string. something happen bad if in a row the first
pixbuf is NULL, so it doesn't occupy any place, but in the following row
there is a pixbuf and occupy some place. the default behavior of
gtktreeview will align the second column so leave a large blank in first
row.

How can I tell treeview not align in different row, but just place the
column independently?

Thanks.
Bin

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


make a window without the title bar

2007-12-14 Thread Binary Chen
I know it is a feature of window manager, but is there any portable way
in GTK+ to do this?

Thanks.
Bin

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


can GtkWindow be a child of another GtkWindow?

2007-12-13 Thread Binary Chen
Hi,

I have a GtkWindow with type GTK_WINDOW_POPUP, I want it to be a child
of a GtkWindow, the effect will be the pop up window can only move
within the scope of the parent window. And if I invoke the position
function for the popup window, the coordinat parameters is relative to
the parent window.

Is it possible? Or any alternative way to achieve this?

Thanks.
Bin

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


GTK button doesn't send signal repeatedly

2007-12-12 Thread Binary Chen
Hi,

When I keep presssing the button, it doesn't emit the signal repeatedly
as time goes, it only emit one. How can I enable it to send the signal
repeatedly in a specified interval?

Thanks.
Bin

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


take a snapshot of a window

2007-12-09 Thread Binary Chen
Hi,

I just want to develop a feature to take a snapshot of a gtk widget, is
it easy to do? It should be saved into a pixbuf.

Thanks.
Bin

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


Re: I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
On Thu, 2007-12-06 at 13:59 +, Emmanuele Bassi wrote:
> again: no need to reply to me directly.
> 
> On Thu, 2007-12-06 at 20:29 +0800, Binary Chen wrote:
> 
> >  
> > > what's happening is that you are blocking the main loop from ever
> > > running, so any result you see is an undefined behaviour.
> > > 
> > > for the third time: use a timeout/idle source instead of the while()
> > > loop to hook into the GTK+ main loop.
> 
> > You don't know my situation.
> 
> I read your other emails in this thread and I can say I understood
> fairly well your situation; and yet, you don't seem to understand what
> I'm saying to you: what are you doing leads to undefined behaviours, so
> *don't do it*.
> 
> > I am using gdk_draw_image to draw a GdkImage to the drawing area.
> 
> why are you using a GdkImage in the first place? can't you just use a
> client-side pixbuf and then blit it to the target widget using
> gdk_draw_pixbuf() instead?
> 
> anyway:
> 
> > g_timeout_add is too slow because it need to update the screen  > 20
> > times/sec.
> 
> 20 times per sec is 50 msecs, which is fairly doable for a timeout
> source; you might want to disable the double buffering and set the
> widget you're drawing on as paintable, to squeeze it every millisecond.
> 
> in any case, instead of using a timeout you can use an idle source with
> g_idle_add_full(), and setting a fairly high priority (but probably
> lower than GDK_PRIORITY_REDRAW to avoid useless tearing).
> 
> > So I need to use a FAST blit to screen, which is only possible using
> > busy while...
> 
> there already is a busy loop: it's the GTK+ main loop. you can hook into
> it, but you cannot avoid calling it because (and this is the central
> bit) it leads to undefined behaviours like you witnessed.
> 
> aside from this, I cannot stress enough that it seems to me you don't
> know GTK+ (let alone GDK) well enough. so my recommendation is for you
> to spend some time learning and getting acquainted with how GTK+ works
> first.
Thanks !! I solved this by using g_timeout_add, sorry for my
misunderstanding becoz I vaguely remember g_timeout_add take the
parameter in second precision, wrong.

And another problem is after I set the priority to -90, the window's
close button seems not very responsive, I think the GTK+ is busying
doing the timeout function, so what priority you suggest to use in this
application?

Thanks!
Bin

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


Re: I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
On Thu, 2007-12-06 at 11:53 +, Emmanuele Bassi wrote:
> On Thu, 2007-12-06 at 19:40 +0800, Binary Chen wrote:
> >  
> > > gdk_draw_image() forces a flush. but that is not the problem: you should
> > > never use a while() loop inside a GTK+ application, because you are
> > > effectively blocking the real main loop from spinning. remember: GTK+ is
> > > not threaded.
> > 
> > Yes, I know GTK+ is not threaded, there is only one thread running, so
> > this make things more complecated, whats loop am I prohibit running?
> 
> the main loop that processes and delivers the events and handles the
> redraws, and that is invoked by gtk_main(). you should read the GTK+
> documentation, at this point.
> 
> > Again I'd like to say in both testing the gtk_main() is not running at
> > all, so whats the difference? Can you point out the exact source of such
> > headache problem?
> 
> the exact source is, in this case, a PEBKAC; the documentation available
> on how GTK+ works (at this level, at least) is quite abundant; the GTK+
> tutorial should shed some more light.
> 
> > > 
> > > use a timeout or an idle source to repaint your window with the
> > > GdkImage.
> > > 
> > This is just a testing program, not production code, I just want to find
> > out whats happening.
> 
> what's happening is that you are blocking the main loop from ever
> running, so any result you see is an undefined behaviour.
> 
> for the third time: use a timeout/idle source instead of the while()
> loop to hook into the GTK+ main loop.
You don't know my situation. I am writing a media player which need to
copy the decoded bitmap into screen.
I am using gdk_draw_image to draw a GdkImage to the drawing area.
g_timeout_add is too slow because it need to update the screen  > 20
times/sec.
So I need to use a FAST blit to screen, which is only possible using
busy while... but only if the delay is very small using usleep(1), the
result is - no things on screen.
Image a situation that a thread is doing decoding and put the result in
somewhere memory, another thread drawing to GTK+ widget.

Bin

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


Re: I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
On Thu, 2007-12-06 at 11:33 +, Emmanuele Bassi wrote:
> there's no need to reply to me: I'm subscribe to the list, so reply
> there.
> 
> On Thu, 2007-12-06 at 18:54 +0800, Binary Chen wrote:
> > On Thu, 2007-12-06 at 10:41 +, Emmanuele Bassi wrote:
> > > On Thu, 2007-12-06 at 17:40 +0800, Binary Chen wrote:
> > > 
> > > > while (1) {
> > > > sleep(1);
> > > > gdk_draw_image(drawing->window, gc, img, 0, 0, 0, 0, 
> > > > 200, 200);
> > > > }
> > > 
> > > you are blocking with your own loop before entering inside the gtk+ main
> > > loop with the following call:
> > > 
> > > > gtk_main();
> > > 
> > But without the sleep() I will also not reach gtk_main(), but the window
> > shows, why? What I am asking is this.
> 
> gdk_draw_image() forces a flush. but that is not the problem: you should
> never use a while() loop inside a GTK+ application, because you are
> effectively blocking the real main loop from spinning. remember: GTK+ is
> not threaded.

Yes, I know GTK+ is not threaded, there is only one thread running, so
this make things more complecated, whats loop am I prohibit running?
Again I'd like to say in both testing the gtk_main() is not running at
all, so whats the difference? Can you point out the exact source of such
headache problem?
> 
> use a timeout or an idle source to repaint your window with the
> GdkImage.
> 
This is just a testing program, not production code, I just want to find
out whats happening.

Thanks.


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


Re: I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
On Thu, 2007-12-06 at 06:01 -0500, Behdad Esfahbod wrote:
> On Thu, 2007-12-06 at 18:54 +0800, Binary Chen wrote:
> > 
> > But without the sleep() I will also not reach gtk_main(), but the
> > window shows, why? What I am asking is this.
> 
> I'm guessing that it fills the drawing buffer and forces a flush.  That
> is, with the sleep, given enough time, you will see the same result.
> You just need to be patient.
> 
How long? Are you sure?

Thanks.

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


Re: I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
On Thu, 2007-12-06 at 10:41 +, Emmanuele Bassi wrote:
> On Thu, 2007-12-06 at 17:40 +0800, Binary Chen wrote:
> 
> > while (1) {
> > sleep(1);
> > gdk_draw_image(drawing->window, gc, img, 0, 0, 0, 0, 200, 200);
> > }
> 
> you are blocking with your own loop before entering inside the gtk+ main
> loop with the following call:
> 
> > gtk_main();
> 
But without the sleep() I will also not reach gtk_main(), but the window
shows, why? What I am asking is this.

Thanks.


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


Can gdk image attach to a window?

2007-12-06 Thread Binary Chen
Hi,

I am writing a video player using a commercial codec library. The
library will callback my function when one frame of video has been
decoded. The decoded frame is placed in a memory which is set by me. And
the callback is started in another thead different from main thread.

I know xlib has big problem when using in multi threaded environment. So
I can't update a widget that is created in main thread.

The problem comes, if I create all the widget in main thread, then I
can't manipulate the widget in the callback.

So GdkImage helps me, because I can tell the library to put the decoded
bitmap in GdkImage->mem. But how can GdkImage draw to screen
automatically? I only know I can use gdk_draw_image to draw a GdkImage
to a drawing area, this means I need to call this function in main
thread to display the GdkImage, damn!!

Is there any better way? I think if I can "attach" a GdkImage to a
widget then the problem resolved.

Thanks.
Bin

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


I can't understand the difference output of only a line differ

2007-12-06 Thread Binary Chen
Hi,

I tried gdk_draw_image with a small program, but the behavior is very
confusing, please help me find out whats happening.

With the sleep(1) the program shows nothing, but without it the window
will show, why?

Thanks.
Bin

#include 

main(int argc, char **argv)
{
int ret;

gtk_init(&argc, &argv);

GtkWidget *win;
GtkWidget *drawing;
GdkImage *img;
GdkGC *gc;

win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
drawing = gtk_drawing_area_new();
gtk_widget_set_size_request(drawing, 200, 200);
gtk_container_add(GTK_CONTAINER(win), drawing);
img = gdk_image_new(GDK_IMAGE_FASTEST, gdk_visual_get_system(),
200, 200);

memset(img->mem, 1, 200 * 200 * 2);

gtk_widget_show_all(win);

gc = gdk_gc_new(drawing->window);

while (1) {
sleep(1);
gdk_draw_image(drawing->window, gc, img, 0, 0, 0, 0, 200, 200);
}

gtk_main();

}

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


Re: write a media player using gtk+

2007-12-02 Thread Binary Chen
On Sun, 2007-12-02 at 09:45 +, [EMAIL PROTECTED] wrote:
> On Dec 2, 2007 3:51 AM, Binary Chen <[EMAIL PROTECTED]> wrote:
> > Do you know how you get the video memory address of the gdk drawable? I
> > want to use memcpy to do the copying, because the gdk-draw-rgb-image
> > can't be accessed during two different threads.
> 
> X doesn't let you do this, because it has to work over a network. What
> is your platform? Which gtk backend are you using?

I am using tinyX(which is contained in X11 source code) backend, the
tinyX is based on framebuffer device.

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


Re: write a media player using gtk+

2007-12-01 Thread Binary Chen
On Fri, 2007-11-30 at 11:31 +, [EMAIL PROTECTED] wrote:
> On Nov 30, 2007 2:45 AM, Bin Chen <[EMAIL PROTECTED]> wrote:
> > image, but I am not familiar with XLib, so I want to know if it is
> > possible to use pure GTK+ API to achieve this? What about the
> > performance comparing to use XLib directly?
> 
> You can use gdk_draw_rgb_image() to paint an RGB array to the screen:
> 
> http://library.gnome.org/devel/gdk/unstable/gdk-GdkRGB.html#gdk-draw-rgb-image
> 
> This is a wrapper over the XImage functions, including XShm when
> available, plus some nice dithering code. It's about as quick as you
> can get with vanilla X11 calls. There's a tiny program in
> gtk+-2.x.x/tests/testrgb.c which benchmarks your computer for drawing
> speed with his operation. You could try that and see if it's going to
> be quick enough for you.
> 
> If you want to go faster, you need to use another (non-X11) rendering
> path. One possibility is the Xv extension, another is to go via
> OpenGL. Both are somewhat hairy :-( and much less portable. As Ken
> says, unless you really want to do this all yourself, GStreamer might
> be the way to go.

My decoded image is RGB565 format, this function is RGB32 format,
unfortunately my hardware also provides RGB565 capability... this means
the system need to do a RGB565 -> RGB32 -> RGB565 transalation... quite
unefficient.

Is there a more direct way?

Thanks.
Bin

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


Re: write a media player using gtk+

2007-12-01 Thread Binary Chen
On Fri, 2007-11-30 at 11:31 +, [EMAIL PROTECTED] wrote:
> On Nov 30, 2007 2:45 AM, Bin Chen <[EMAIL PROTECTED]> wrote:
> > image, but I am not familiar with XLib, so I want to know if it is
> > possible to use pure GTK+ API to achieve this? What about the
> > performance comparing to use XLib directly?
> 
> You can use gdk_draw_rgb_image() to paint an RGB array to the screen:
> 
> http://library.gnome.org/devel/gdk/unstable/gdk-GdkRGB.html#gdk-draw-rgb-image
> 
> This is a wrapper over the XImage functions, including XShm when
> available, plus some nice dithering code. It's about as quick as you
> can get with vanilla X11 calls. There's a tiny program in
> gtk+-2.x.x/tests/testrgb.c which benchmarks your computer for drawing
> speed with his operation. You could try that and see if it's going to
> be quick enough for you.
> 
> If you want to go faster, you need to use another (non-X11) rendering
> path. One possibility is the Xv extension, another is to go via
> OpenGL. Both are somewhat hairy :-( and much less portable. As Ken
> says, unless you really want to do this all yourself, GStreamer might
> be the way to go.

Do you know how you get the video memory address of the gdk drawable? I
want to use memcpy to do the copying, because the gdk-draw-rgb-image
can't be accessed during two different threads.

Thanks.
Bin

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


Re: Profiling GTK within an application

2007-10-29 Thread Binary Chen
On Sat, 2007-10-27 at 11:06 +0300, Stefan Kost wrote:
> Chris Rorvick schrieb:
> > I'm attempting to profile GTK in an application and I'm wondering what 
> > methodology others use to accomplish this.  Is there any documentation 
> > that addresses this topic that I should refer to?  Any caveats worth 
> > pointing out?  Here is where I'm at ...
> > 
> > I recently upgraded an application using GTK 2.6 to use GTK 2.10, 
> > quickly followed by an upgrade to 2.12.  In both cases, the upgraded 
> > version of the application consumed 3-5x the CPU as compared to the 
> > original version using 2.6.  This comparison was done anecdotally using 
> > top on a Solaris workstation.
> >
> This is most likely caused by cairo. You should also see a bit less CPU usage 
> in
> 2.12 compared to 2.10 (or more precise newer cairo should perform a bit 
> better).
> 
Which version of cairo will cause this problem, more precise?

> > 
> > My first step was to have profiled versions of these libraries built in 
> > the hope that I could use them to isolate where the additional cycles 
> > were being burned.  Several builds and profiled runs later, and after a 
> > fair amount of searching the Internet, I've concluded that I'll never 
> > get anything out of shared objects instrumented with GCC; all code to be 
> > profiled must be statically linked.  If you know this to be untrue, 
> > please let me know!  :)  My plan now is to build static versions of all 
> > GTK libraries instrumented for profiling and link against those.
> > 
> I would suggest to use a sampling profiler, like oprofile, sysprof, but all
> those are linux profilers (they need a kernel module). But I am sure there a
> sampling profilers for solaris too. The advantage is that you don't need to
> recompile your apps (given you have debug symbols alreday) and it works with
> shared libs too.
> 
> Stefan
> 
> 
> > FYI, Our platform is Solaris 10 (x86) compiling with GCC 3.4.
> > 
> > Thanks in advance,
> > 
> > Chris Rorvick
> > ___
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: Tooltips on GtkTreeView

2007-10-15 Thread Binary Chen
On Mon, 2007-10-15 at 09:08 -0600, Kevin DeKorte wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Hi All,
> 
> Is there an easy way to set a tooltip on a GtkTreeView for the row that
> the user is hovering their cursor over. It is not guaranteed that the
> row the user is over is the selected row. Also if the tooltip can be set
> on row addition that is fine.

How about connect a motion-notify-event signal and show the tooltips in
in the signal handler?
Seems like:
g_signal_connect(G_OBJECT(gtkblist->treeview), "motion-notify-event",
G_CALLBACK(pidgin_blist_motion_cb), NULL);

in the handler:

gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), event->x, event->y,
&path, NULL, NULL, NULL);

> 
> Thanks,
> 
> Kevin
> 
> 
> - --
> Get my public GnuPG key from
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
> 
> iD8DBQFHE4J36w2kMH0L1dERAtU9AJ9HF5NzcpSHu8eyBs+NtySsBqhxPwCfZJOO
> rk2/0oVHAd2NCMvzbNYSLPw=
> =dEv8
> -END PGP SIGNATURE-
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


GTK+ window startup notification

2007-10-15 Thread Binary Chen
Hi,

I know in X there is a machnism called startup notification, one
"launcher" can listen to the various windowing message to draw a task
list window accordingly.

But I now use GTK+ on a different backend(directfb) which seems no
startup notification implemented, so I seek if the GTK+ has built in
this feature so I can listen to GTK application startup notification
message?

Thanks in advance.
Bin

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


Re: Add a Scrollbar

2007-10-12 Thread Binary Chen
You can simple make a vbox and then add the vbox to the tab's window,
then reparent all the frames to vbox.

On Thu, 2007-10-04 at 18:24 +0200, [EMAIL PROTECTED] wrote:
> A simple question:
> what is the best way to add a vertical scrollbar to a widget?
> In my case the widget is a notebook tab containing some frames (it shows many
> contents), so I have to handle the case in which the frames overlap the tab's
> height, including a scrollbar to browse them.
> Thanks in advance. Regards,
> 
> Omar
> 
> 
> This message was sent using IMP, the Internet Messaging Program.
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


gtkfb

2007-09-23 Thread Binary Chen
Hi,

Is gtkfb still developed? I want to use it instead of directfb, is this
idea viable?

And is there any window manager based on gtkfb?

Thanks.
Bin

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


Change the mouse pointer to sandglass

2007-09-20 Thread Binary Chen
Hi,

I want change to mouse pointer to sandglass to indicate the system is
busy, how can i do it?

Thanks.
Bin

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


Gobject constructor question

2007-09-04 Thread Binary Chen
Hi,

I have a doubt of GObject's constructor machnism, do i need to explicit
to invoke the parent's constructor in a chiild constructor?

Thanks.
Bin


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


GTK treeview very slow?

2007-09-02 Thread Binary Chen
Hi,

I am running GTK treeview in a slow machine, say, with a 200MHz CPU, I
am using a treeview with about 20 nodes as total. When I scroll the
treeview scroll bar, the image get to freeze for a while...

I then try with a simpler table with 1 column, the speed is quite fast,
I can aware the freeze when scrolling.

I want to confirm is my conclution is right? The treeview is
significantly slower then other container?

Thanks.
Bin

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


Re: pixbuf in event box in treeview

2007-08-30 Thread Binary Chen
On Thu, 2007-08-30 at 19:06 +0200, David Nečas (Yeti) wrote:
> On Thu, Aug 30, 2007 at 09:59:33PM +0800, Binary Chen wrote:
> > I want to put a event box in a treeview column, with a pixbuf in the
> > event box, how to set the column render?
> 
> Cell renderers are not widgets, so this is impossible (==
> does not make sense). In some cases you can use (or abuse)
> the `activate' mechanism, subclass a cell renderer class and
> and override the activate() virtual method.  But IIRC only
> button press events are delivered this way.  So generally it
> will be probably necessary to track the events in the whole
> tree view and use the provided helper functions to find the
> cell corresponding to the event's coordinates.
> 
> Yeti
And an alternative to me is embedded a button in a treeview column, but
I also don't know how to do... no renderer available.



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


Re: pixbuf in event box in treeview

2007-08-30 Thread Binary Chen
On Thu, 2007-08-30 at 19:06 +0200, David Nečas (Yeti) wrote:
> On Thu, Aug 30, 2007 at 09:59:33PM +0800, Binary Chen wrote:
> > I want to put a event box in a treeview column, with a pixbuf in the
> > event box, how to set the column render?
> 
> Cell renderers are not widgets, so this is impossible (==
> does not make sense). In some cases you can use (or abuse)
> the `activate' mechanism, subclass a cell renderer class and
> and override the activate() virtual method.  But IIRC only
> button press events are delivered this way.  So generally it
> will be probably necessary to track the events in the whole
> tree view and use the provided helper functions to find the
> cell corresponding to the event's coordinates.
> 
> Yeti
Thanks, you mean if i derive a class from pixbuf cell renderer, and
implement the activate() method, then if mouse click the image which is
rendered by the renderer, the activate() will be get called?



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


pixbuf in event box in treeview

2007-08-30 Thread Binary Chen
Hi,

I want to put a event box in a treeview column, with a pixbuf in the
event box, how to set the column render?

I am confusing...

Thanks.
Bin

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


Setting treeview column width

2007-08-29 Thread Binary Chen
Hi,

With following code, I still can't make a fixed sized treeview column,
the column's width is large even after I have set its size, whats wrong
with it? Any other thing affect it?

column = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(column, _("Name"));
gtk_tree_view_column_set_fixed_width(column, 3);
gtk_tree_view_column_set_sizing(column,
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview), column,
-1);
gtk_tree_view_column_set_resizable(column, FALSE);


Thanks in advance.
Bin

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


Change double click activate to single click in treeview

2007-08-29 Thread Binary Chen
Hi,

Currently treeview treat double-click mouse event as activation event
for a row, I want to change it to single-click, how can I do this?

Thanks.
Bin

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