re: quarks
hi!, Someone knows like quarks works in glib. I can not find the source code, only the header. Itś suppose we don need free the string inside a static string of a quarks. But how is that???. Where is the string saved?. any help? . Regards. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_signal_emit()
Kristian Rietveld wrote: On Sun, Aug 31, 2008 at 2:08 PM, dhk <[EMAIL PROTECTED]> wrote: I have two callback functions. The first for when a cell in a treeview gets edited and the second for when the tab key is pressed. The first works fine. In the second, I want to emit the "edited" signal so it acts as if the first event happened. However, the g_signal_emit() in the "key-press-event" callback does not seem to work. I am doing the following and the renderer and sig_id are valid. sig_id=g_signal_lookup("edited", G_OBJECT_TYPE(renderer)); g_signal_emit(renderer, sig_id, 0); It looks like you are trying to emit the edited signal here without specifying the correct arguments. In short what I'm trying to do is emit the "edited" event when the "key-press-event" occurs. That way when the use tabs off the cell in the treeview the callback for the "edited" event is called. It doesn't make sense the if there are two way to leave a cell (tabbing off it or clicking outside of it) that you can't call the same event. Maybe you can try using gtk_cell_editable_editing_done() here? The editing-done signal handler of the respective cell editable will take care of emitting the edited signal. You can get hold of the correct cell editable by listening for the editing-started signal on the cell renderer. regards, -kris. That sounds like it could work. I'll see if I can get the GtkCellEditable from gtk_cell_renderer_start_editing(). That seems to take a lot of parameter that I don't have. I'll let you know what happens. Thanks, dave ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_signal_emit()
On Sun, Aug 31, 2008 at 2:08 PM, dhk <[EMAIL PROTECTED]> wrote: >> I have two callback functions. The first for when a cell in a treeview >> gets edited and the second for when the tab key is pressed. The first works >> fine. In the second, I want to emit the "edited" signal so it acts as if >> the first event happened. However, the g_signal_emit() in the >> "key-press-event" callback does not seem to work. >> >> I am doing the following and the renderer and sig_id are valid. >> >> sig_id=g_signal_lookup("edited", G_OBJECT_TYPE(renderer)); >> g_signal_emit(renderer, sig_id, 0); It looks like you are trying to emit the edited signal here without specifying the correct arguments. > In short what I'm trying to do is emit the "edited" event when the > "key-press-event" occurs. That way when the use tabs off the cell in the > treeview the callback for the "edited" event is called. It doesn't make > sense the if there are two way to leave a cell (tabbing off it or clicking > outside of it) that you can't call the same event. Maybe you can try using gtk_cell_editable_editing_done() here? The editing-done signal handler of the respective cell editable will take care of emitting the edited signal. You can get hold of the correct cell editable by listening for the editing-started signal on the cell renderer. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: increase cell height in a GtkTreeView
(Apologies for such a late reply, I hope it is still of use). On Fri, Aug 1, 2008 at 11:37 AM, Nicolas Soubeiran <[EMAIL PROTECTED]> wrote: > Hi all, > I need to create a treeview with a column which displays a pixbuf that > becomes bigger when the user hovers the row. So I create a cellrenderer > which display either the big pixbuf either the small pixbuf depending of the > value of the GtkCellRendererState flag (if PRELIT then display big pixbuf, > else small). It works except that the height of the cell is always the same > so when the big pixbuf should be displayed, it is troncated. Once a row got its size calculated and allocated, it will not change unless the data in the model changes (signaled via row-changed). When GtkTreeView receives row-changed for a row, it will recalculate the requested height for that row by re-querying the cell renderers. Apart from this, cell renderers cannot influence the height of the row. > I want to know how to ask the cell to request more space. Currently I've > copy/paste the render and get_size fonction of gtk_cell_renderer_pixbuf in > my component. The easiest solution is to emit the row-changed signal (using gtk_tree_model_row_changed()) once the row has to update its height. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Default icon in treeview DnD
On Wed, Aug 27, 2008 at 6:55 PM, Jeffrey Barish <[EMAIL PROTECTED]> wrote: >> On Tue, Aug 26, 2008 at 10:55 PM, Jeffrey Barish >> <[EMAIL PROTECTED]> wrote: >> Did you override the drag-begin signal or stop using >> gtk_tree_view_enable_model_drag_source()? These are both possible >> causes for not getting an image of the row as drag icon. > > I call gtk_drag_begin for a drag from tv2 to itself. However, I do not > handle the signal. I call gtk_tree_view_enable_model_drag_source for a > drag from tv1 to tv2 (the drag that works correctly). I tried changing the > code for the drag from tv1 to tv2 so that it also uses > gtk_tree_view_enable_model_drag_source (which defeats some of the > functionality I need) instead of gtk_drag_begin. I still get the wrong > icon for that drag. You will have to call gtk_tree_view_enable_model_drag_source() if you want an image of the row as drag icon. If you do not do so, you will get the "default" image. If using that does not work, like you said, are you maybe overriding GtkTreeView's button press handler? And are you seeing any assertions that might be relevant? > In examining my code, I noticed that I am specifying targets like this: > > ('tv1_row', GTK_TARGET_SAME_APP, 1) > > I have the identical specification for source and destination. However, > every example I see has targets that look like this: > > ('tv1_row', 0, 1) > > Sometimes the source target looks the same and sometimes it looks like my > first example (in which case the source and destination targets do not > match). Moreover, 0 isn't even a valid value for the second parameter. It > seems as if the second parameter doesn't matter. Is that conclusion > correct? As far as I know the target specification does not influence which drag icon you will get. regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: scrollbars for treeview
On Thu, Aug 28, 2008 at 3:53 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Sorry, I forgot to mention: I was trying this solution for a > long time now -- but it is somehow buggy (try adding and > removing lines and try setting the adjustments by code -> > at some point the widgets are not displayed correctly > anymore). And, from the gtk doc this is explicitly not > recommended for widgets with built-in ability of scrolling. There should be no need to set the adjustment by code. GtkTreeView will create its own adjustments and set these on the scrolled window. If you change these adjustments yourself, there is a good chance that things become messed up ... regards, -kris. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_signal_emit()
dhk wrote: I have two callback functions. The first for when a cell in a treeview gets edited and the second for when the tab key is pressed. The first works fine. In the second, I want to emit the "edited" signal so it acts as if the first event happened. However, the g_signal_emit() in the "key-press-event" callback does not seem to work. I am doing the following and the renderer and sig_id are valid. sig_id=g_signal_lookup("edited", G_OBJECT_TYPE(renderer)); g_signal_emit(renderer, sig_id, 0); When I get to the g_signal_emit() call I get the following error. g_signal_emit(renderer, sig_id, 0); Program received signal SIGSEGV, Segmentation fault. 0x7f712d797ad0 in strlen () from /lib/libc.so.6 The backtrace from gdb is: #0 0x7f712d797ad0 in strlen () from /lib/libc.so.6 #1 0x7f712ddfbd03 in g_strdup () from /usr/lib/libglib-2.0.so.0 #2 0x7f712e4b7dc8 in ?? () from /usr/lib/libgobject-2.0.so.0 #3 0x7f712e4a4897 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0 #4 0x7f712e4a4db3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0 If I use g_signal_emit_by_name() I get the following error in gdb. g_signal_emit_by_name(G_OBJECT(renderer), "edited::cellEditedCb"); or g_signal_emit_by_name(G_OBJECT(renderer), "edited::0"); WARNING gsignal.c:2140: signal id `193' does not support detail (1256) All I'm trying to do is have the "key-press-event" act like the "edited" event when the tab key is pressed. How can this be done? Thanks, dave ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list In short what I'm trying to do is emit the "edited" event when the "key-press-event" occurs. That way when the use tabs off the cell in the treeview the callback for the "edited" event is called. It doesn't make sense the if there are two way to leave a cell (tabbing off it or clicking outside of it) that you can't call the same event. Any ideas? Thanks, dave ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Divided notebooks...
From: "Thomas Dybdahl Ahle" [EMAIL PROTECTED] > søn, 31 08 2008 kl. 05:23 -0400, skrev Freddie Unpenstein: >> GTK provides the facility to have a GtkNotebook without tabs. But as >> far as I can tell, it doesn't provide the facility to have tabs >> without the notebook pages. It seems somehow strange to me, and >> causes people to hack together their own button bars that function >> vaguely like Notebook tabs but nowhere near as functional, consistent, >> or in many cases accessible either. My question is whether there's a >> better way to achieve the same functionality. > Most of the time I believe that separated tabs and pages are > unintuitive, Most of the time, I believe you're right. If we had a split notebook, I'd expect the "normal" usage to be what we now know and love as GtkNotebook. > however for two cases I believe it is currently nessesary > as a hack: When you don't want a border around your pages, For some reason I thought you could already turn that off... Hmmm.. > and when you > want widgets next to the tabs (like the close button in older firefox). My Firefox still does that... Have they changed that for the newer one? It must have kept the old setting on mine when I upgraded, then, I guess... Close buttons on tabs is something that I detest with a passion even on decent computers. I love being able to simply click on the close button three times and have three tabs close, rather than having to chase the close buttons across the tab bar. ;) There've also been some VERY bad implementations of in-tab close buttons...! One of the worse I've see causes the tab to grow to accommodate the close button, which is shown on mouse over, causing all the tabs after it to jump around like they're on drugs. Firefox doesn't do that, but still, a close button at the end of the tab-bar is especially painful on my slow system where it can take half a minute before anything actually happens. ;) > While the former is being resolved in the latest gtk's using a new > property, I don't see much progress for the latter. That's where my comment at the end was aimed. Splitting the two, even if you go and put them right back together again in the normal case, allows for all sorts of edge cases to be handled cleanly. Arbitrary buttons before and after the button bar, widgets that are common to every page can be placed around the part that does the swapping, and cases where it makes sense to share pages between tabs. > In my app, PyChess, I use one notebook for tabs and 5 for pages, which > switch synchronously. This is done in order to preserve the > VPaned/HPaned layout through pages. Can't say I've seen it to be sure I understand what you're saying about the V/H Paned layout factor... However... In the simplest case, I'd like to be able to create tabs and pages individually; switching to a tab would emit a tab switched signal with a gpointer as user_data. The default handler would then interpret that as the notebook page to be presented, and the usual functions for adding pages would link them thusly. You could, however, intercept the tab switched signal and handle the value stored in the tab however you wished. For example, you could have a notebook with shared pages as I'm doing, or just one page in which you place a bunch of widgets, one of which would be another notebook with the actual pages those tabs refer to, or any combination thereof. In my case, I'd have the tab switched handler let the default handler run unmollested if GTK_IS_NOTEBOOK_PAGE(user_data) is true, but handle it specially by loading it into a shared page otherwise. As far as I can see, all it needs is for the tab switched signal to be interceptable, and a new API function that will present a page without disturbing the tab bar. Can anyone think of a reason why a change like that would break anything? Then all that'd be needed would be to allow buttons alongside the tab bar, and we'd all be happy. ;) Fredderic ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How to center vbox inside full screen window
Hi All, I have a very simple GTK program (in C) that creates a full screen window. Inside the full screen window I am placing a vbox with two elements inside: and image and a label. For the life of me I cannot figure out how to get the contents of the vbox to be packed together. I.e. I want the image + label touching each other and centered on the screen. Currently the height of the vbox seems to fill the height of the screen with the image and label distributed inside (and not touching). Any help is appreciated! Thanks, Christian ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Divided notebooks...
søn, 31 08 2008 kl. 05:23 -0400, skrev Freddie Unpenstein: > GTK provides the facility to have a GtkNotebook without tabs. But as > far as I can tell, it doesn't provide the facility to have tabs > without the notebook pages. It seems somehow strange to me, and > causes people to hack together their own button bars that function > vaguely like Notebook tabs but nowhere near as functional, consistent, > or in many cases accessible either. My question is whether there's a > better way to achieve the same functionality. Most of the time I believe that separated tabs and pages are unintuitive, however for two cases I believe it is currently nessesary as a hack: When you don't want a border around your pages, and when you want widgets next to the tabs (like the close button in older firefox). While the former is being resolved in the latest gtk's using a new property, I don't see much progress for the latter. In my app, PyChess, I use one notebook for tabs and 5 for pages, which switch synchronously. This is done in order to preserve the VPaned/HPaned layout through pages. -- Best Regards, Med Venlig Hilsen, Thomas Bomb, Riksdagen, Regeringen, Död, Terror, Mord, Planer, Muslimska brödraskapet, Alluah akbar, Kärnkraft Stop the Swedish surveillance: stoppafralagen.nu ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Divided notebooks...
GTK provides the facility to have a GtkNotebook without tabs. But as far as I can tell, it doesn't provide the facility to have tabs without the notebook pages. It seems somehow strange to me, and causes people to hack together their own button bars that function vaguely like Notebook tabs but nowhere near as functional, consistent, or in many cases accessible either. My question is whether there's a better way to achieve the same functionality. At present, I'm creating two GtkNotebook's, the upper one is just for the tabs, while the lower one has the pages. There are two pages pre-built and are used to present almost all pages the notebook needs to contain by using the regular load/save/revert mechanics to flip data records as needed. A few other special-use pages are then also added in as needed, and the whole lot are re-orderable through the facilities built into the notebook widget. Somewhat annoyingly, tabs are mostly referenced by their associated child widget, and you have to have a child widget in order to add a tab. So for each tab I set the child as an un-shown simple widget, onto which I attach the relevant data record using g_object_set_data(). The tab switched signal then simply presents the relevant page and loads it with data from the data record. Now, I thought of using a list, but notebook tabs are not only significantly lighter, but seem much more natural as well; there's that direct visual association between the name on the tab and the content of the page, plus they look a whole lot nicer. Once there's a few more pages it might make sense to rotate the tabs to the side, but more than a dozen or so doesn't make a lot of sense to my application at all anyhow. So can I have my tabs, and my pages too? What other widget is there that's better suited than a list, when notebook tabs are almost perfect? My personal feeling is that GtkNotebook should be a GtkBox that by default, contains a GtkNotebookTabs widget and a GtkNotebookPages widget. The GtkBox itself should possess the functionality to change which edge the tabs are on (by flipping child order and changing layout direction), with appropriate signals used to let child widgets (such as thee tab bar) know when it needs to change its layout direction (in the default case, the opposite to the parent box's direction, but always keeping normal child order). But I suppose that's somewhat of a dream, along with similarly merging the Gtk[HV]Separators and any other widget that has both a H and V version. (Was there ever actually a practical reason for doing that, other than to show off the wonders of object derivation..? Personally I think separators should be a function of GtkBox rather than a distinct widget entirely; something like gtk_box_enable_separator_before|after(), so it can automatically merge them as needed.) Fredderic ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [semi-OT] dependencies libraries
On Sun, 31 Aug 2008 10:41:42 +0200 Andrea Zagli wrote: > how can i do to know the exact libraries versions which my > applications depends on? > > for example: if i develop with gtk 2.12 (but i can do the same > reasoning with any other library) how can i do to know if i used (or > not) new functions/classes introduced on that version? (of course > without look inside library documentation for every function/class > that i used) That's pretty much the only way to do it, looking through the documentation. If you really want to target a specific minimum version (say, 2.8), then you should develop against that version. -brian ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[semi-OT] dependencies libraries
how can i do to know the exact libraries versions which my applications depends on? for example: if i develop with gtk 2.12 (but i can do the same reasoning with any other library) how can i do to know if i used (or not) new functions/classes introduced on that version? (of course without look inside library documentation for every function/class that i used) thanks ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list