Re: Background color problem
Sorry, for being a bit stupid and persistent I appreciate your help, but I've also faced with structures: When I changed a bit your example (I used 1 instead of 0) ClutterColor clutter_background_color = { 1, }; g_debug(Colors: %x %x %x %x, clutter_background_color.red, clutter_background_color.blue, clutter_background_color.green, clutter_background_color.alpha); I didn't get an expected result {1, 1, 1, 1}, I got {1, 0, 0, 0}: DEBUG: Colors: 1 0 0 0 Is the example { num, } suitable only for {0,}? Or it makes the first field equal to num. The others attempts such as {1, 2,}; make the first and the second field equal to 1 and 2, the third and so on are zero. Thank you Vlad Volodin 2009/3/17 Emmanuele Bassi eba...@gmail.com: On Tue, 2009-03-17 at 07:41 +0300, Vlad Volodin wrote: Sorry, I've asked this question, but I can't find any explanation: GdkColor gdk_color = { 0, }; ClutterColor clutter_color = { 0, }; They are structures, why do you use commas before the last brackets? because it will initialize all the members of a struct to 0. it's equivalent to: GdkColor gdk_color = { 0, 0, 0, 0 }; ClutterColor clutter_color = { 0, 0, 0, 0 }; or to: GdkColor gdk_color; ClutterColor clutter_color; memset (gdk_color, 0, sizeof (GdkColor)); memset (clutter_color, 0, sizeof (ClutterColor)); or, in C99: GdkColor gdk_color = { .pixel = 0, .red = 0, .green = 0, .blue = 0 }; ClutterColor clutter_color = { .red = 0, .green = 0, .blue = 0, .alpha = 0 }; I've found C99 standard, where the same rule is applied to enum type too. it doesn't have anything to do with enumerations -- enumerations will use the number to set their value explicitly, and it's something coming from ANSI C, way before C99. ciao, Emmanuele. Best wishes, Vlad Volodin 2009/3/17 Emmanuele Bassi eba...@gmail.com: On Mon, 2009-03-16 at 23:28 +0300, Vlad Volodin wrote: first of all, you really want to use the clutter list. I'm using libclutter-gtk (with GtkClutterEmbed widget), where I want to display some graphics. If somebody doesn't know it, I'll describe it a bit. It is derived from GtkWidget. Then it uses it's own canvas. The canvas is white, and it doesn't have some kind of transparency. So, as I thought, I decided to fill it's background with color, got from it's GtkStyle. After some experiments I realized, that widgets (main window, container and GtkClutterEmbed) don't have needed color: Containers in GTK+ do not usually have a background: they are assumed to be transparent transparent. GtkWindow does have a background color, though, since it'll have to provide the background for most widgets. to set the color of the Stage embedded inside GtkClutterEmbed you can get a specific color out of the GtkWindow style; you cannot do this at any time you like: you'll have to connect to the style-set signal of the GtkWindow that contains the GtkClutterEmbed-- at which point you have a guarantee that a GtkStyle has been applied to the widget. also, you have to remember that GdkColor and ClutterColor are not compatible structures: you have to convert between the two. GdkColor gdk_color = { 0, }; ClutterColor clutter_color = { 0, }; gdk_color = widget-style-bg[GTK_STATE_NORMAL]; clutter_color.red = CLAMP (((gdk_color.red / 65535.0) * 255), 0, 255); clutter_color.green = CLAMP (((gdk_color.green / 65535.0) * 255), 0, 255); clutter_color.blue = CLAMP (((gdk_color.blue / 65535.0) * 255), 0, 255); clutter_color.alpha = 255; ciao, Emmanuele. -- Emmanuele Bassi, W: http://www.emmanuelebassi.net B: http://log.emmanuelebassi.net ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- Emmanuele Bassi, W: http://www.emmanuelebassi.net B: http://log.emmanuelebassi.net ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GIO channels and connection closed by foreign host on WIN32
On Tue, Mar 17, 2009 at 6:59 PM, Tor Lillqvist t...@iki.fi wrote: (Yes, it might well be that it should be considerd a bug that one on Windows has to explicitly watch for G_IO_HUP in addition to G_IO_IN to be able to catch EOF. Please file a bug for that. This change made the trick: g_io_add_watch(ch, (GIOCondition) G_IO_IN|G_IO_HUP, cbk, NULL); I filed a bug about this behaviour, 575806, I just replied here to tell that with G_IO_HUP in the callback also the classic logic if recv(fd) == 0 then IS DISCONNECT works. The exact intended semantics of the GIOChannel API isn' clearly specified IMHO, and even if it was, one can say that it is more important that code that de facto does work on Unix should also work on Windows, even if strictly speaking the code would not need to work even on Unix according to specs... ) Why? The only real problem was the fact the cbk was void. GIOChannel API give the user a g_io_channel_unix_get_fd() call, so I suppose it should be supported handling the channel yourself. This is a very important feature since there are a few network toolkit that can be made interoperable with GTK through this feature. -- Bye, Gabry ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Problem with continuous image updation in a while loop
In my application, I am implementing status indication (displaying either 'red' or 'green' ) by using Gdkpixmap to assign an image to 'red' or 'green' pixel array. i display or hide the image by calling gtk_widget_show (..) or gtk_widget_hide(..) . The structure of my application is as follows: int main() { 1. Assign Pixmaps --- On Tue, 3/10/09, Jim George jimgeo...@gmail.com wrote: From: Jim George jimgeo...@gmail.com Subject: Re: Continuous variable updation in a text box To: aj...@knac.com Cc: gtk-app-devel-list@gnome.org Date: Tuesday, March 10, 2009, 8:19 PM It wouldn't matter too much, since most screens would only have a refresh rate of 60-120 Hz, which is also much higher than what most people can even see. I've handled such cases by using g_idle_add when I get an update of the variable's status, and have the idle function update the text box. I preserve the event source ID for the next call, and check if that source is still available. If so, I remove the event using g_source_remove and add a new idle event. This way, the most recent update is shown on screen the next time my program goes idle. The idle function then marks the source as free, by setting it to zero. -Jim Ardhan Madras wrote: So you will need call textbox insertion (update) 1000 times per second or the textbox get updated every 1ms, my question is: Can you see it changes correctly with given cycle? --- adeelmali...@yahoo.com wrote: From: Adeel Malik adeelmali...@yahoo.com To: Subject: Continuous variable updation in a text box Date: Tue, 10 Mar 2009 02:48:15 -0700 (PDT) I intend to monitor the variable's value (acquired via data acquisition hardware) at a rate of around 1,000 times per second. I haven't used textboxes before in GTK+. Could anyone suggest how to update the value of a variable in a textbox etc., at this rate. Thanks, Adeel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _ Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com ___ 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: Problem with continuous image updation in a while loop
In my application, I am implementing status indication (displaying either 'red' or 'green' ) by using Gdkpixmap to assign an image to 'red' or 'green' pixel array. i display or hide the image by calling gtk_widget_show (..) or gtk_widget_hide(..) . The structure of my application is as follows: int main() { 1. Assign Pixmaps --- On Tue, 3/10/09, Jim George jimgeo...@gmail.com wrote: From: Jim George jimgeo...@gmail.com Subject: Re: Continuous variable updation in a text box To: aj...@knac.com Cc: gtk-app-devel-list@gnome.org Date: Tuesday, March 10, 2009, 8:19 PM It wouldn't matter too much, since most screens would only have a refresh rate of 60-120 Hz, which is also much higher than what most people can even see. I've handled such cases by using g_idle_add when I get an update of the variable's status, and have the idle function update the text box. I preserve the event source ID for the next call, and check if that source is still available. If so, I remove the event using g_source_remove and add a new idle event. This way, the most recent update is shown on screen the next time my program goes idle. The idle function then marks the source as free, by setting it to zero. -Jim Ardhan Madras wrote: So you will need call textbox insertion (update) 1000 times per second or the textbox get updated every 1ms, my question is: Can you see it changes correctly with given cycle? --- adeelmali...@yahoo.com wrote: From: Adeel Malik adeelmali...@yahoo.com To: Subject: Continuous variable updation in a text box Date: Tue, 10 Mar 2009 02:48:15 -0700 (PDT) I intend to monitor the variable's value (acquired via data acquisition hardware) at a rate of around 1,000 times per second. I haven't used textboxes before in GTK+. Could anyone suggest how to update the value of a variable in a textbox etc., at this rate. Thanks, Adeel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _ Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com ___ 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: Problem with continuous image updation
Looks like you want to update a widget state by running a busy loop in a main loop or by using small delay. If you try this, your widget is never (look) updated.., avoid using sleep or busy loop in the gtk_main() main loop. you should try attach a new source with g_timeout_add*() functions, and set a timeout when the function should be called. Notice that g_timeout_add*() may be delayed. ... static gboolean show_hide (gpointer data) { static gboolean state = TRUE; if (state) { gtk_widget_show (green); gtk_widget_hide (red); state = FALSE; } else { gtk_widget_show (red); gtk_widget_hide (green); state = TRUE; } return TRUE; } ... and in the button callback, try: g_timeout_add (200, (GSourceFunc) show_hide, NULL); /* call every 200ms */ to remove the source, use g_source_remove(). Another way is to create thread, then call g_idle_add() to set your widgets. --- ajhwb --- adeelmali...@yahoo.com wrote: From: Adeel Malik adeelmali...@yahoo.com To: Jim George jimgeo...@gmail.com Cc: gtk-app-devel-list@gnome.org Subject: Re: Problem with continuous image updation Date: Wed, 18 Mar 2009 02:31:23 -0700 (PDT) In my application, I am implementing status indication (displaying either 'red' or 'green' ) by using Gdkpixmap to assign an image to 'red' or 'green' pixel array. I display or hide the image by calling gtk_widget_show (..) or gtk_widget_hide(..) once the start button is clicked in the main gtk window. The structure of my application is as follows: int main() { 1. Assign Pixmaps 2. Set up the start button 3. Wait for the start button press 3. rest in gtk_main () } button_function(...) { //while loop while (...) { .. if status=0 { gtk_widget_hide(green); gtk_widget_show(red); } else { gtk_widget_hide(red); gtk_widget_show(green); } It appears that gtk is not upating the image during the whole course of while loop (which is running at just 15 cycles/s) based on 'status' variable. However, afer the while loop is finished, I get the updated status image. Could someone suggest what additonal gtk calls I have to make to make sure that the status image is updated (red or green) whenever there is a change in the value of status variable in the while loop of ' start button' function. Thanks, Adeel --- On Tue, 3/10/09, Jim George jimgeo...@gmail.com wrote: From: Jim George jimgeo...@gmail.com Subject: Re: Continuous variable updation in a text box To: aj...@knac.com Cc: gtk-app-devel-list@gnome.org Date: Tuesday, March 10, 2009, 8:19 PM It wouldn't matter too much, since most screens would only have a refresh rate of 60-120 Hz, which is also much higher than what most people can even see. I've handled such cases by using g_idle_add when I get an update of the variable's status, and have the idle function update the text box. I preserve the event source ID for the next call, and check if that source is still available. If so, I remove the event using g_source_remove and add a new idle event. This way, the most recent update is shown on screen the next time my program goes idle. The idle function then marks the source as free, by setting it to zero. -Jim Ardhan Madras wrote: So you will need call textbox insertion (update) 1000 times per second or the textbox get updated every 1ms, my question is: Can you see it changes correctly with given cycle? --- adeelmali...@yahoo.com wrote: From: Adeel Malik adeelmali...@yahoo.com To: gtk-app-devel-list@gnome.org Subject: Continuous variable updation in a text box Date: Tue, 10 Mar 2009 02:48:15 -0700 (PDT) I intend to monitor the variable's value (acquired via data acquisition hardware) at a rate of around 1,000 times per second. I haven't used textboxes before in GTK+. Could anyone suggest how to update the value of a variable in a textbox etc., at this rate. Thanks, Adeel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _ Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com ___ 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 _ Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org
is this good code?
I've never fully understood the timing issues with signals and callbacks. Is this good or evil (vala) code? public bool ensureConnected () { /* try to connect, if not already connected */ if (!connectButton.get_active()) connectButton.set_active(true); /* are we connected now? */ return connectButton.get_active(); } The last line is support to report back whether or not the preceding set_active(true) was successful. Some error in the code call by the set_active signal could have caused it to revert to the false state. Anyway, I guess the question is: has all code tied to the set_active(true) signal executed before the last line? - Mike ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: is this good code?
On Wed, Mar 18, 2009 at 8:25 AM, Dr. Michael J. Chudobiak m...@avtechpulse.com wrote: I've never fully understood the timing issues with signals and callbacks. Is this good or evil (vala) code? public bool ensureConnected () { /* try to connect, if not already connected */ if (!connectButton.get_active()) connectButton.set_active(true); /* are we connected now? */ return connectButton.get_active(); } The last line is support to report back whether or not the preceding set_active(true) was successful. Some error in the code call by the set_active signal could have caused it to revert to the false state. Anyway, I guess the question is: has all code tied to the set_active(true) signal executed before the last line? I dont know vala at all and I can tell you yes this code is perfectly safe, assuming the signal is implemented as a GSignal, which is a pretty safe assumption (someone will soon correct me if I'm wrong though ;-)). Signals in GObject execute synchronously so nothing to worry about. Cheers, -Tristan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: is this good code?
Tristan Van Berkom wrote: Anyway, I guess the question is: has all code tied to the set_active(true) signal executed before the last line? I dont know vala at all and I can tell you yes this code is perfectly safe, assuming the signal is implemented as a GSignal, which is a pretty safe assumption (someone will soon correct me if I'm wrong though ;-)). Signals in GObject execute synchronously so nothing to worry about. Thanks, that's exactly what I needed to know! - Mike ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GWeakNotify fired earlier than expected
Hi, On Mon, Mar 16, 2009 at 12:45 PM, IdaRub ida...@gmail.com wrote: After reading the gobject code a bit more, it seems that weak references are fired on dispose, not finalize: Right, that's correct. All of the documentation I could find states that it happens during finalization, but it seems it should all say that it happens during dispose. Probably true. dispose is typically done during finalize, but can happen sooner also. dispose can happen multiple times. In my example this detail is actually very important. Doesn't look like there is a way to catch dispose without shimming the instance handler. Any ideas? You mean there's no way to catch finalize? Finalize deliberately can't be intercepted, because it raises a lot of thorny issues about reentrancy; what if the object is used or its refcount increased during finalization? So things are split into two phases, dispose() which you can get notifications about (and which can happen multiple times); and finalize which actually frees the object. Havoc ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
support gtk+ about zoom in a widget
Hi, First, I want to zoom in a window just like when we use IE browser,sometime we can't see the web page clearly, so we will use [Ctrl]+[mouse wheel] keys to zoom the page in, in that case we can see the web page clearly! please tell me how to do that in gtk! Thanks! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: support gtk+ about zoom in a widget
Original Message Subject: support gtk+ about zoom in a widget From: 呉永 w...@shcore.com.cn To: gtk-app-devel-list@gnome.org Date: 03/16/2009 08:23 PM Hi, First, I want to zoom in a window just like when we use IE browser,sometime we can't see the web page clearly, so we will use [Ctrl]+[mouse wheel] keys to zoom the page in, in that case we can see the web page clearly! please tell me how to do that in gtk! You will need to setup a GDK keypress event signal on the widget you wish to zoom on. Then you'll need to write code that will do the zooming when the key presses you want are pressed. A.K.A. when the signal is called. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
enumerating available fonts
How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: enumerating available fonts
On 03/18/2009 05:14 PM, Chuck Crisler wrote: How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. pango_font_map_list_families()? behdad Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
getting system UI defaults
How do you get system default values such as text color, window background color, desktop color, etc? Thank you, Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: enumerating available fonts
That function seems to list 'families' for a given 'font map'. But it seems that you have to have a font map to begin. I simply want to know all of the fonts on the system, like open office writer. Chuck On Wed, 2009-03-18 at 17:16 -0400, Behdad Esfahbod wrote: On 03/18/2009 05:14 PM, Chuck Crisler wrote: How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. pango_font_map_list_families()? behdad Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: enumerating available fonts
How do I enumerate the fonts available on a system? Here's a little function using Gtkmm that I use... vectorstring* LXUtils::GetAllFontNames() { // RETURN a pointer to a static string vector that contains the font names static vectorstring vsFonts; if (vsFonts.empty()) { // Only bother to do this the first time through LXMainWindow* pWind = LXMainWindow::GetAppMainWindow(); // Get Gtk::Window* Glib::RefPtrPango::Context rPC = pWind-get_pango_context(); Glib::ArrayHandle Glib::RefPtrPango::FontFamily fonts = rPC-list_families(); Glib::Container_Helpers::ArrayHandleIteratorGlib::Container_Helpers::TypeTraitsGlib::RefPtrPango::FontFamily iFont = fonts.begin(); for (; iFont != fonts.end(); iFont++) { vsFonts.push_back((*iFont)-get_name()); } } return vsFonts; } -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: enumerating available fonts
On 03/18/2009 05:23 PM, Chuck Crisler wrote: That function seems to list 'families' for a given 'font map'. But it seems that you have to have a font map to begin. pango_cairo_font_map_get_default(). behdad I simply want to know all of the fonts on the system, like open office writer. Chuck On Wed, 2009-03-18 at 17:16 -0400, Behdad Esfahbod wrote: On 03/18/2009 05:14 PM, Chuck Crisler wrote: How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. pango_font_map_list_families()? behdad Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Popup window for alert
I would like a popup window with a black line on its border in which I can put a label to alert the user to a failure condition. A Dialog doesn't work because the appearance and disappearance of the window is entirely under program control. A WINDOW_POPUP doesn't work because it lacks the black line on its border (even when I set decorate). A WINDOW_TOPLEVEL is almost right, but I would prefer that the destroy button and the window menu button not appear -- not to mention the title bar at the top. Is there a way to make any of these things disappear? -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Popup window for alert
On Wed, 18 Mar 2009 16:55:35 -0600 Jeffrey Barish jeff_bar...@earthlink.net wrote: I would like a popup window with a black line on its border in which I can put a label to alert the user to a failure condition. A Dialog doesn't work because the appearance and disappearance of the window is entirely under program control. A WINDOW_POPUP doesn't work because it lacks the black line on its border (even when I set decorate). A WINDOW_TOPLEVEL is almost right, but I would prefer that the destroy button and the window menu button not appear -- not to mention the title bar at the top. Is there a way to make any of these things disappear? You can do everything with a normal window, Jeffrey. Look up the right functions, but you can: 1) Make de decorations disappear, leaving a clean rectangle. 2) Put an image on the background, with the black border you want, making it fill the window entirely, 3) Put a label in the center of that window, and enter the text you wish to show. You might want to search for the many examples of 'splash screens' with GTK available on the 'net. John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Popup window for alert
You can use GdkWindowTypeHint value to set window decoration, the gtk_window_set_type_hint(). If you want to the window is not deletable, use gtk_window_set_deletable(). For example: ... gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_deletable (window, FALSE); ... Try to call them before showing the window. -- ajhwb --- jeff_bar...@earthlink.net wrote: From: Jeffrey Barish jeff_bar...@earthlink.net To: gtk-app-devel-list@gnome.org Subject: Popup window for alert Date: Wed, 18 Mar 2009 16:55:35 -0600 I would like a popup window with a black line on its border in which I can put a label to alert the user to a failure condition. A Dialog doesn't work because the appearance and disappearance of the window is entirely under program control. A WINDOW_POPUP doesn't work because it lacks the black line on its border (even when I set decorate). A WINDOW_TOPLEVEL is almost right, but I would prefer that the destroy button and the window menu button not appear -- not to mention the title bar at the top. Is there a way to make any of these things disappear? -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _ Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Popup window for alert
John Coppens wrote: On Wed, 18 Mar 2009 16:55:35 -0600 Jeffrey Barish jeff_bar...@earthlink.net wrote: I would like a popup window with a black line on its border in which I can put a label to alert the user to a failure condition. A Dialog doesn't work because the appearance and disappearance of the window is entirely under program control. A WINDOW_POPUP doesn't work because it lacks the black line on its border (even when I set decorate). A WINDOW_TOPLEVEL is almost right, but I would prefer that the destroy button and the window menu button not appear -- not to mention the title bar at the top. Is there a way to make any of these things disappear? You can do everything with a normal window, Jeffrey. Look up the right functions, but you can: 1) Make de decorations disappear, leaving a clean rectangle. 2) Put an image on the background, with the black border you want, making it fill the window entirely, 3) Put a label in the center of that window, and enter the text you wish to show. You might want to search for the many examples of 'splash screens' with GTK available on the 'net. Thanks to you and Ardhan for the suggestions. They led me to the following solution: Get the Gdk_Window. It has a set_decorations method. One of the options is DECOR_BORDER, which draws only a black line around the window -- no title bar. -- Jeffrey Barish ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list