How to set the window widget's border to zero
Hello everyone You know, the gtk_container_set_border_width function can set the border's width of container but ,when i use this function to set my application's main window's border to zero , I failed I want my main window has no border ,how to achieve this ? I need your help Any comments would be much appreciated,and thanks in advance ! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to set the window widget's border to zero
On Tue, Aug 29, 2006 at 02:31:05PM +0800, chao yeaj wrote: You know, the gtk_container_set_border_width function can set the border's width of container but ,when i use this function to set my application's main window's border to zero , I failed gtk_container_set_border_width() works with GtkWindows the same way as with any other GtkContainer. And the default border width *is* zero. You probably don't want to change container border width at all but change *window manager decorations* instead. I want my main window has no border ,how to achieve this ? Cross your fingers and use http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#gtk-window-set-decorated As usual, the window manager can ignore it (mine definitely will). Windows that lack decorations are much harder to move and resize (even impossible with some window managers) so it's generally a bad idea to disable them. Yeti P.S.: Since this is not your first question about changing window manager behaviour, ensure you read and understood http://developer.gnome.org/doc/API/2.0/gtk/gtk-x11.html#gtk-X11-arch -- Anonyms eat their boogers. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
The dial's pointer looks like a sawtooth,how to render it ?
Hello everyone In the Gtk+2.0 tutorial,there is a dial widget When i enlarge it, the pointer's like a sawtooth, How to render it ,in order to make it more smoothly ? I have no idea, i need your help Any comments would be much appreciated ,and thanks in advance ! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: The dial's pointer looks like a sawtooth,how to render it ?
On Tue, Aug 29, 2006 at 04:17:50PM +0800, chao yeaj wrote: In the Gtk+2.0 tutorial,there is a dial widget The GtkDial part of the tutorial is deprecated and should not be used when writing new widgets[*]. It is not GObject based at all, it uses functions like gtk_widget_draw() and IIRC the widget is functionally broken too. I suggest to read the text with a grain of salt, ignoring the code altogether and looking at the corresponding code of a real modern Gtk+ widget instead. [*] This is not an `official' statement, it's just a paraphrase of what Gtk+ documentation says about the methods used. When i enlarge it, the pointer's like a sawtooth, I don't observe anything like this. However the dial pointer is drawn with gtk_draw_polygon() (another deprecated function), therefore the look can be very theme dependent. Yeti -- Anonyms eat their boogers. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
help on scrollbars
Hi, I'm working on an app and I'm facing the need to access the button at the end of a vertical scrollbar of a scrolled window to do something like a gtk_button_clicked() to ensure that the widget (a treeview) contained in it gets scrolled to the end with whatever screen resolution is used. This obviously in the assumption that this little buttons are real gtk_buttons I read most of the source and reference but haven't found nothing usefull and I also have tried some alternatives like: void list_vertical_autoscroll(GtkWidget *list) { GtkAdjustment *adjustment; adjustment = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list)); gtk_adjustment_set_value(adjustment, adjustment-upper += ARBITRARY_BIG_NUMBER); /*or*/ gtk_adjustment_set_value(adjustment, adjustment-upper +adjustment-page_size); } that achieve some scrolling but not to the very end of the treeview. The only thing that works the way i would like it is to click with mouse on the v button that's why I'm looking for a way to fake this click with a function. Could someone make me see the light? Am i totally wrong? TIA and Ciao, Tito ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: help on scrollbars
On Tue, Aug 29, 2006 at 02:11:09PM +0200, [EMAIL PROTECTED] wrote: I'm working on an app and I'm facing the need to access the button at the end of a vertical scrollbar of a scrolled window to do something like a gtk_button_clicked() to ensure that the widget (a treeview) contained in it gets scrolled to the end with whatever screen resolution is used. This obviously in the assumption that this little buttons are real gtk_buttons I read most of the source and reference but haven't found nothing usefull and I also have tried some alternatives like: void list_vertical_autoscroll(GtkWidget *list) { GtkAdjustment *adjustment; adjustment = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list)); gtk_adjustment_set_value(adjustment, adjustment-upper += ARBITRARY_BIG_NUMBER); /*or*/ gtk_adjustment_set_value(adjustment, adjustment-upper +adjustment-page_size); } that achieve some scrolling but not to the very end of the treeview. The only thing that works the way i would like it is to click with mouse on the v button that's why I'm looking for a way to fake this click with a function. Could someone make me see the light? As far as I understand you just need to copy the couple of lines from step_forward() (or step_back()) in gtkrange.c, replacing g_signal_emit() with g_signal_emit_by_name(). Yeti -- Anonyms eat their boogers. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How to save/load GtkTreeStore into a file?
Hello all,... ...i try to load a GtkTreeStore from a file that i was saving with gtk_tree_store_foreach calling a function inheritting gtk_tree_model_get_string_from_iter (the 0:0,0:1,1:0:0,... thing) and gtk_tree_model_get . Now it would be seem easy to me to be done with gtk_tree_model_get_iter_from_string and gtk_tree_store_set. The Problem is, by meaning, there is no node to iterate for the factive virtual node referenced by the string. Anyone could tell me the preferable way to save/load GtkTreeStores ?? regards chabayo ___ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: help on scrollbars
[EMAIL PROTECTED] wrote: Hi, I'm working on an app and I'm facing the need to access the button at the end of a vertical scrollbar of a scrolled window to do something like a gtk_button_clicked() to ensure that the widget (a treeview) contained in it gets scrolled to the end with whatever screen resolution is used. Untested. This might help: gtk_adjustment_set_value (gtk_scrolled_window_get_adjustment (scrolled_window), DBL_MAX); where `scrolled_window' contains the tree, of course. Actually `DBL_MAX' can be replaced with any large enough value, like 1e100, if you don't want to include `float.h'. Paul ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: The dial's pointer looks like a sawtooth,how to render it ?
For a very good, up-to-date, and GObject-based widget written using cairo, check out this tutorial: http://gnomejournal.org/article/34/writing-a-widget-using-cairo-and-gtk28 Cheers, Samuel On 8/29/06, David Nečas (Yeti) [EMAIL PROTECTED] wrote: On Tue, Aug 29, 2006 at 04:17:50PM +0800, chao yeaj wrote: In the Gtk+2.0 tutorial,there is a dial widget The GtkDial part of the tutorial is deprecated and should not be used when writing new widgets[*]. It is not GObject based at all, it uses functions like gtk_widget_draw() and IIRC the widget is functionally broken too. I suggest to read the text with a grain of salt, ignoring the code altogether and looking at the corresponding code of a real modern Gtk+ widget instead. [*] This is not an `official' statement, it's just a paraphrase of what Gtk+ documentation says about the methods used. When i enlarge it, the pointer's like a sawtooth, I don't observe anything like this. However the dial pointer is drawn with gtk_draw_polygon() (another deprecated function), therefore the look can be very theme dependent. Yeti -- Anonyms eat their boogers. ___ 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: Dealing with drawingArea update (refresh) for multiple drawings.
If you have the drawing area in a variable called da, then you can do: gtk_widget_queue_draw_area(da, 0, 0, da-allocation.width, da-allocation.height); ... everytime you want to update the drawing area, it generates an expose event and will call your expose_event_callback. It works for me. HTH, bye. El 26/08/06 09:38, Gustavo Sikora escribió: Hi there, I'll go straight to the point: I'm trying to draw some data structures like, leftist heaps, B tree, binomial heaps and I'm in a hurry trying to use gtk and cairo to draw and develop all of the GUI. But I'm new to this matters, and I'm not finding an apropriate way to draw multiple nodes as I walk the structures. ie: I have an empty drawingArea and buttons to let me insert elements. After each insetion I wish to draw the current state of the structure. Now, I'm only able to draw the first node, and for some reason the expose_event only applies when I minimize the interface and open it again. Some code of what I'm doing: gboolean expose_event_callback (GtkWidget *widget, GdkEventExpose *event) { cairo_t *cr; /* get a cairo_t */ cr = gdk_cairo_create (widget-window); cairo_rectangle (cr, event-area.x, event-area.y, event-area.width, event-area.height); cairo_clip (cr); newHeap-drawHeap(cr); cairo_destroy (cr); return TRUE; } void insert_callback(GtkWidget *widget, gpointer info) { const gchar *key, *priority; key = gtk_entry_get_text(GTK_ENTRY(keyValue)); priority = gtk_entry_get_text(GTK_ENTRY(priorityValue)); gtk_entry_set_text (GTK_ENTRY (keyValue), ); gtk_entry_set_text (GTK_ENTRY (priorityValue), ); insert(atoi(key), atoi(priority), newHeap); } ... //initialization of my drawingArea drawArea = gtk_drawing_area_new(); gtk_box_pack_start (GTK_BOX (box1), drawArea, FALSE, FALSE, 0); gtk_drawing_area_size(GTK_DRAWING_AREA (drawArea), 1010, 657); gtk_signal_connect(GTK_OBJECT (drawArea), expose_event, GTK_SIGNAL_FUNC (expose_event_callback), 0); gtk_widget_show(drawArea); ... //drawHeap from my leftistHeap.h - not complete, only testing for real drawing ... templateclass T void leftisitHeapT::drawHeap(cairo_t *cr) { drawHeap(raizPtr, cr); } templateclass T void leftistHeapT::drawHeap(nodeLeftHeapT *auxPtr, cairo_t *cr) { if (raizPtr == 0) return; else { if (auxPtr != 0) { double x, y; x = 505; y = 25; double radius; radius = 12; cairo_arc (cr, x, y, radius, 0, 2 * M_PI); cairo_set_source_rgb (cr, i, i, i); cairo_fill_preserve (cr); cairo_set_source_rgb (cr, 0, 0, 0); cairo_stroke (cr); drawHeap(auxPtr-getClftPtr(), cr); drawHeap(auxPtr-getCrgtPtr(), cr); } } } My question again: How can I draw multiple figures (nodes) and make them visible as soon as I insert a new element? I found something like swapbuffers for ogl + gtk; pixmap or pixbuff for simple gtk+ and even only the regular expose_event callback... I'll really apreciate any help. (links, materials, tutorials... I googled a lot and find a lot of stuff, but too many things regarding python and ruby... I'm dealing with C/C++ btw, I sent this same question to a Cairo list, and they told me to use gtk_widget_queue_draw_area everytime I should draw something new and also said that I could use gdk_window_invalidate_rect on my insetion callback. Once they told me this list would help me more then the cairo one, since it's more of a gtk doubt, here I am. Once more, I would really be glad with any help. I'll try now what they told me. Thanks in advance ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- Ivan Baldo - [EMAIL PROTECTED] - http://ibaldo.codigolibre.net/ ICQ 10215364 - Phone/FAX (598) (2) 613 3223. Caldas 1781, Malvin, Montevideo, Uruguay, South America. We believe that we are free, but in reality we are not! Are we? Alternatives: [EMAIL PROTECTED] - http://go.to/ibaldo ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
problem with gtk view
hi I have created textview widget through GLADE application and showing char strings on text view which is created by glade interface designer 2.0 available with Fedorra-1 The problem is that sometimes it is working correctly but other times segfault is coming. There are two threads are running One for main thread transmitting and other continuously looking for message As I think it is a problem with showing window with textviwew widget bcoz with other window problem is not there nbsp; The part of code with problem: nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; ReceiveWindow=create_rcv_FreetextWindow (); nbsp;nbsp;nbsp;nbsp;nbsp; GtkTextBuffer *buffer; nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\n window created\\n\); //sleep(5);//every timenbsp; when it failsnbsp; it is failing after showing printf statement nbsp;nbsp;nbsp;nbsp;nbsp; gdk_threads_enter();//for making thread safe nbsp;nbsp;nbsp;nbsp;nbsp; //sleep(5); nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\n thread entered\\n\); nbsp;nbsp;nbsp;nbsp;nbsp; gtk_widget_show(ReceiveWindow); nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\n window showed\\n\); nbsp;nbsp;nbsp;nbsp;nbsp; gdk_threads_leave();//for making thread safe nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\n theread leave\\n\); nbsp;nbsp;nbsp;nbsp;nbsp; for (i=0; ilt;100;i++) printf(\\\a\);//for sound alert on receing the message nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\n window showed\\n\); nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW (lookup_widget(GTK_WIDGET(ReceiveWindow),\textview1\))); nbsp;nbsp;nbsp;nbsp;nbsp; gtk_label_set_text(GTK_LABEL(lookup_widget(ReceiveWindow,\Fromnamelabel\)),\\); nbsp;nbsp;nbsp;nbsp;nbsp; printf(\\\nText Message is %s\\n\,x_fields-gt;val); nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; This is errors coming before giving segfault in run time nbsp;nbsp;nbsp;nbsp;nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; (fot:19108): Gtk-CRITICAL **: file gtktexttag.c: line 1932 (gtk_text_attributes_ref): assertion `values != NULL\' failed nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; nbsp;nbsp;nbsp;nbsp;nbsp; (fot:19108): Gtk-CRITICAL **: file gtktexttag.c: line 1932 (gtk_text_attributes_ref): assertion `values != NULL\' failed nbsp; nbsp;window created Segmentation fault nbsp; any help is greatly appriciated rajesh ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list