Re: GtkComboBox - how to clear and repopulate in one step?

2007-12-06 Thread Tiberius DULUMAN
You may create the combo box using gtk_combo_box_new_with_model. You insert all the items that may appear in the second combo box in a GtkListStore. Along with the text, you create a column that contains the index of the items in the first combo box that they belong to. Use a GtkTreeModelFilter ove

RE: Linear Scaling of fonts with FreeType on Cairo

2007-12-06 Thread Karl Reis
I see. Yes, that's right as the error went away when I explicitly specified the win32 font. > -Original Message- > From: Behdad Esfahbod [mailto:[EMAIL PROTECTED] On Behalf Of > Behdad Esfahbod > Sent: Thursday, December 06, 2007 2302 PM > To: Karl Reis > Cc: gtk-app-devel-list@gnome.org

RE: Linear Scaling of fonts with FreeType on Cairo

2007-12-06 Thread Behdad Esfahbod
Great! On Thu, 2007-12-06 at 22:38 -0800, Karl Reis wrote: > I also tried it with the "TOY" font and I got the same error. The toy font backend is not a real backend. Pango doesn't recognize it and can't use it. The available ones are FreeType, win32, and ATSUI. You are using win32 obviously.

RE: Linear Scaling of fonts with FreeType on Cairo

2007-12-06 Thread Karl Reis
Thank you for your excellent reply! I modified the code per your suggestions and it worked perfectly. Here is the full snippet of code for anyone else who might find this useful: cairo_font_options_t*options; cairo_t *cr; PangoFontMap*fm; PangoCont

Re: Linear Scaling of fonts with FreeType on Cairo

2007-12-06 Thread Behdad Esfahbod
On Thu, 2007-12-06 at 19:01 -0800, Karl Reis wrote: > I'm trying to find a way to scale fonts linearly. As far as I can tell, the > way to do it is to use a freetype font and turn hinting off. Using the API, > I tried to pull some code together that would try to do that, but > unfortunately, the

GtkComboBox - how to clear and repopulate in one step?

2007-12-06 Thread asdf
I am using gtk_combo_box_new_text() to setup a combo box to display a list of strings. However, the documentation states that in this case you can only use the following set of related (convenience) functions to manipulate the ComboBox: gtk_combo_box_append_text() gtk_combo_box_insert_text() gtk_

Linear Scaling of fonts with FreeType on Cairo

2007-12-06 Thread Karl Reis
I'm trying to find a way to scale fonts linearly. As far as I can tell, the way to do it is to use a freetype font and turn hinting off. Using the API, I tried to pull some code together that would try to do that, but unfortunately, the font is still scaling non-linearly. cairo_font_op

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

2007-12-06 Thread Liam R E Quin
On Thu, 2007-12-06 at 09:40 -0800, Mike Melanson wrote: > I just wanted to throw out the possibility of asking your client whether > they have any interest in open sourcing the video codec itself? Now would be a good time, if the codec might be useable on the Web -- see for example http://www.webv

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 behavi

ComboBox and set_cell_data_func

2007-12-06 Thread Jeffrey Barish
I am using set_cell_data_func with a ComboBox. I noticed that when I call the append method of the TreeStore, set_cell_data_func is called twice. The first time, the row has not yet been written into the TreeStore, so the set_cell_data_func can't perform its function. Is there a reason that GTK

Scrolling in ComboBox popup

2007-12-06 Thread Jeffrey Barish
Is there a way to control scrolling in the popup for a ComboBox? I have a ComboBox with only 10 items. The ComboBox pops up a window with the active item positioned near the top. If the active item is not one of the first two items, then scrollbars appear and there is a vast empty space below th

Re: how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Lukasz Gromotowicz
I do check glade_xml_new() and all glade_xml_get_widget() for NULL return. Problem is that the gtk_main() is already running as I create new windows in events / callbacks from the existing window. All I would like to do is not to create and not to show the new window if there are any problems. re

Re: how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Jens Sauer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lukasz Gromotowicz schrieb: > Hi all, > > the problem is when loading windows from the xml file: > > glade_xml = glade_xml_new("ami.glade",NULL,NULL); > > I need to know the reference to main window (GtkWindow) to be able to > destroy it, yes? >

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

2007-12-06 Thread Mike Melanson
Binary Chen wrote: > Hi, > > I tried gdk_draw_image with a small program, but the behavior is very > confusing, please help me find out whats happening. [...] I've read through the thread detailing your GTK troubles. I also know you are trying to write a custom GTK player for a particular multim

Re: how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Lukasz Gromotowicz
Maybe you are right. The problem appeared when I have updated the software and .glade but forgot to copy .glade to the destination machine. I could not see any messages, program just did not start. It took me some time to find the problem. It looks like I have to live with it ;0 regards, LUK 2007

Re: how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Lance Dillon
- Original Message From: Jim George <[EMAIL PROTECTED]> To: Lukasz Gromotowicz <[EMAIL PROTECTED]> Cc: gtk-app-devel-list@gnome.org Sent: Thursday, December 6, 2007 8:45:24 AM Subject: Re: how to destroy window if ptr to mainWindow not known On Dec 6, 2007 4:46 AM, Lukasz Gromotowicz <

Re: how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Jim George
On Dec 6, 2007 4:46 AM, Lukasz Gromotowicz <[EMAIL PROTECTED]> wrote: > Hi all, > > the problem is when loading windows from the xml file: > > glade_xml = glade_xml_new("ami.glade",NULL,NULL); > > I need to know the reference to main window (GtkWindow) to be able to > destroy it, yes? > I can

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

2007-12-06 Thread Emmanuele Bassi
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 t

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

2007-12-06 Thread Gregory Hosler
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Binary Chen wrote: > 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 in

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

2007-12-06 Thread Tomas Carnecky
Binary Chen wrote: > 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 u

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

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

2007-12-06 Thread Behdad Esfahbod
On Thu, 2007-12-06 at 06:40 -0500, Behdad Esfahbod wrote: > On Thu, 2007-12-06 at 19:08 +0800, Binary Chen wrote: > > 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

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

2007-12-06 Thread Emmanuele Bassi
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 thread

how to destroy window if ptr to mainWindow not known

2007-12-06 Thread Lukasz Gromotowicz
Hi all, the problem is when loading windows from the xml file: glade_xml = glade_xml_new("ami.glade",NULL,NULL); I need to know the reference to main window (GtkWindow) to be able to destroy it, yes? I can get it like this: window = glade_xml_get_widget(glade_xml,"window1"); and des

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,

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

2007-12-06 Thread Behdad Esfahbod
On Thu, 2007-12-06 at 19:08 +0800, Binary Chen wrote: > 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 th

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

2007-12-06 Thread Emmanuele Bassi
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);

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

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

2007-12-06 Thread Behdad Esfahbod
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 th

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 befor

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

2007-12-06 Thread Emmanuele Bassi
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: >

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 bi

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