problem about node of treeview
Recently,I am working on a configuration for an graphical application,which contains strings ,pixbuf(image).When I add double click function for the node ,it's can work.But the top node in response to double click too.How can I set the top node insensitive.See the function void view_onRowActivated (GtkTreeView *treeview,GtkTreePath *path,GtkTreeViewColumn *col,gpointer userdata) in the attachment.#include stdlib.h #include stdio.h #include errno.h #include string.h #include unistd.h #include netdb.h #include sys/socket.h #include arpa/inet.h #include gtk/gtk.h #include stdio.h #include sys/types.h #include netinet/in.h #include sys/wait.h #include gdk/gdkx.h #define SERVER_PORT #define MAX_MSG_SIZE 1024 char msg[MAX_MSG_SIZE]; void PackNewlabel(GtkWidget *box,char *sLabel); void PackNewcombo(GtkWidget *box); GtkWidget* PackNewentry_chat(GtkWidget *box); void PackNewbatton0(GtkWidget *box,char *button_name); void PackNewbatton1(GtkWidget *box,char *button_name); GtkWidget *create_view_and_model (); GtkTreeModel *create_and_fill_model (); void on_changed(GtkWidget *widget, gpointer statusbar) ; void event_close(); //void select_file_activated(GtkWidget *widget); void view_onRowActivated (GtkTreeView *treeview,GtkTreePath *path,GtkTreeViewColumn *col,gpointer userdata); const char* button_event_chat(GtkWidget *widget,gpointer *data); GtkWidget *name_chat; GtkWidget *button1; GtkTreeStore *treestore; GtkTreeIter toplevel, child; void udp_server(void); void udps_respon(int sockfd); void treeclose(GtkWidget *widget,gpointer *data); extern const char* getip(); extern void UIGetUsrInfo(void *arg); extern int UIGetUsrInfo_auto(void *arg); extern int Mysql_newtable (char *a); extern int Mysql_find_p(); extern int Mysql_insert_p(char *friendip); extern void showmsg(char * msg,char*c); extern int clientrecvfile(); //extern int udp_client_logout(); extern int udp_client(char *text,const char *IP) ; GData *widget_chat_dlg; extern struct Widgets_Chat { GtkWidget *chat_dlg; GtkWidget *textview_output, *textview_input; }arg2; void redraw(); void redelete(); enum { LIST_ICON=0,//explain picture LIST_NAME,//explain name COLUMN , // explain text NUM_COLS }; struct argument { char valueip[17]; }arg1; int tree_view() { gdk_threads_enter(); int res; pthread_t b_thread; res=pthread_create(b_thread,NULL,udp_server,NULL); if(res0) { printf(pthread create failed); exit(1); } GtkWidget *window; GtkWidget *box; GtkWidget *view; GtkTreeSelection *selection; GtkWidget *statusbar; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_signal_connect(GTK_OBJECT(window),destroy,G_CALLBACK(gtk_main_quit),NULL); /*µÇ¼ÇdestroyÐźţ¬µ÷ÓÃÍ˳öº¯Êý*/ box=gtk_vbox_new(FALSE,2); PackNewlabel(box,NO.6_chat_program); PackNewcombo(box); PackNewlabel(box,Please Input IP); PackNewentry_chat(box); PackNewbatton1(box,add); gtk_signal_connect(GTK_OBJECT(button1),pressed,G_CALLBACK(button_event_chat),NULL); gtk_container_add(GTK_CONTAINER(window),box); /*°Ñ×é×°ºÐ·ÅÈë´°Ìå*/ gtk_widget_set_size_request(window, 250, 400); view = create_view_and_model(); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); gtk_box_pack_start(GTK_BOX(box), view, TRUE, TRUE, 1); PackNewbatton0(box,set); statusbar = gtk_statusbar_new(); gtk_box_pack_start(GTK_BOX(box), statusbar, FALSE, TRUE, 1); g_signal_connect(selection, changed,G_CALLBACK(on_changed), statusbar); g_signal_connect(view, row-activated, G_CALLBACK(view_onRowActivated), NULL); gtk_widget_show(box); /*ʹ×é×°ºÐ¿ÉÊÓ*/ gtk_widget_show_all(window);/*ʹ´°Ìå¿É¼û*/ gtk_main(); gdk_threads_leave(); return 1; } void PackNewlabel(GtkWidget *box,char *sLabel) { GtkWidget *label; label=gtk_label_new(sLabel);/*½¨Á¢±êºÅ*/ gtk_box_pack_start(GTK_BOX(box),label,FALSE,FALSE,0); /*°Ñ±êÇ©¿Ø¼þ¼ÓÈë×é×°ºÐ*/ gtk_widget_show(label); } void PackNewcombo(GtkWidget *box) { GtkWidget *combo; combo=gtk_combo_new(); GList *glist=NULL; glist=g_list_append(glist,please choose your station); /*Ìí¼Ó×Ö·û´®µ½Á´±í*/ glist=g_list_append(glist,online); glist=g_list_append(glist,busy); glist=g_list_append(glist,free); gtk_combo_set_popdown_strings(GTK_COMBO(combo),glist); gtk_box_pack_start(GTK_BOX(box),combo,FALSE,FALSE,0); /*°Ñcombo¿Ø¼þ¼ÓÈë×é×°ºÐ*/ gtk_widget_show(combo); } GtkWidget *create_view_and_model () { GtkTreeViewColumn *col; GtkCellRenderer *renderer_text;//explain text GtkCellRenderer *renderer_icon;// explain picture GtkCellRenderer *renderer_name;//explain name
Re: problem about node of treeview
I assume the GtkTreePath *path is the row where double click happened. You can easily determine if it's a top node or not in your callback function, just do nothing if it is. From the on-line reference: A path is essentially a potential node. It is a location on a model that may or may not actually correspond to a node on a specific model. The GtkTreePath struct can be converted into either an array of unsigned integers or a string. The string form is a list of numbers separated by a colon. Each number refers to the offset at that level. Thus, the path “0” refers to the root node and the path “2:4” refers to the fifth child of the third node. Use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-path-to-string to convert a path to a string. Or, you can use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-model-get-iter-first to get the iter for top node and compare with the double clicked iter to see if it's the same one. Dong From: wang yi feng renlei...@126.com To: gtk-app-devel-list@gnome.org Sent: Wednesday, November 2, 2011 8:38 AM Subject: problem about node of treeview Recently,I am working on a configuration for an graphical application,which contains strings ,pixbuf(image).When I add double click function for the node ,it's can work.But the top node in response to double click too.How can I set the top node insensitive.See the function void view_onRowActivated (GtkTreeView *treeview,GtkTreePath *path,GtkTreeViewColumn *col,gpointer userdata) in the attachment. ___ 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:Re: problem about node of treeview
thanks very much At 2011-11-02 22:46:42,Dong Luo us...@yahoo.com wrote: I assume the GtkTreePath *path is the row where double click happened. You can easily determine if it's a top node or not in your callback function, just do nothing if it is. From the on-line reference: A path is essentially a potential node. It is a location on a model that may or may not actually correspond to a node on a specific model. TheGtkTreePath struct can be converted into either an array of unsigned integers or a string. The string form is a list of numbers separated by a colon. Each number refers to the offset at that level. Thus, the path“0” refers to the root node and the path“2:4” refers to the fifth child of the third node. Use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-path-to-string to convert a path to a string. Or, you can use http://developer.gnome.org/gtk/2.24/GtkTreeModel.html#gtk-tree-model-get-iter-first to get the iter for top node and compare with the double clicked iter to see if it's the same one. Dong From: wang yi feng renlei...@126.com To:gtk-app-devel-list@gnome.org Sent: Wednesday, November 2, 2011 8:38 AM Subject: problem about node of treeview Recently,I am working on a configuration for an graphical application,which contains strings ,pixbuf(image).When I add double click function for the node ,it's can work.But the top node in response to double click too.How can I set the top node insensitive.See the function void view_onRowActivated (GtkTreeView *treeview,GtkTreePath *path,GtkTreeViewColumn *col,gpointer userdata) in the attachment. ___ 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: Patch for updating gtk over wayland interface
HI, On Tue, Nov 1, 2011 at 10:06 PM, Zhao, Juan J juan.j.z...@intel.com wrote: Hi there, These days I built gtk+ in my platform and updated the interface and fixing some problems with the help from wayland-devel. Now the first step is done: some simple applications in gtk+/test can work well now. So I send this patch to gtk-devel for review and asking for suggestions. As I know, Bnf in wayland-devel also has interest on this and has similar patch. So I also add him and ask for suggestion. I’m not sure which patch format gtk-devel likes, so I just send it with attachment not by “git send-email”. The preferred way is that you submit a new bug and attach the patch (using git format-patch) to GNOME's bugzilla (bugzilla.gnome.org). That way the patch wont be lost on the mailing list. Greetings José Of course there are still lots of further works should be done, I will go on to fix there. - *^_^* BRs, Juan ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: Patch for updating gtk over wayland interface
For review its always better to git send-email, and since this is wayland related it should be fine to send gdk-wayland patches to the wayland-list, maybe with a gtk prefix. To comment on the patch i'll copy the relevant parts for now. - wl_display_sync_callback(display_wayland-wl_display, sync_callback, done); + callback=wl_display_sync(display_wayland-wl_display); + wl_callback_add_listener(callback, sync_listener, done); + wl_display_iterate(display_wayland-wl_display, WL_DISPLAY_WRITABLE); while (!done) wl_display_iterate(display_wayland-wl_display, WL_DISPLAY_READABLE); + There is a wl_display_roundtrip that can be used now. +/* no visual interface for wayland now */ +#undef WL_VISUAL_HANDLE Since wl_visuals are really removed, everything that used or handled wl_visuals should be replaced with the use of egl configs and/or the shm format tokens. Just temporarily disabling those code paths is ugly. - visual = display-premultiplied_argb_visual; + visual = WL_SHM_FORMAT_XRGB32; This should give a warning since WL_SHM_FORMAT_XRGB32 is an integer not a pointer. The type of visual is still struct wl_visual * (where the struct is declared nowhere). So assigning the new SHM tokens to the old wl_visual variables should be avoided, rather use some sth like: enum wl_shm_format format = WL_SHM_FORMAT_XRGB32. 2011/11/2 Zhao, Juan J juan.j.z...@intel.com: Hi there, These days I built gtk+ in my platform and updated the interface and fixing some problems with the help from wayland-devel. Now the first step is done: some simple applications in gtk+/test can work well now. So I send this patch to gtk-devel for review and asking for suggestions. As I know, Bnf in wayland-devel also has interest on this and has similar patch. So I also add him and ask for suggestion. I’m not sure which patch format gtk-devel likes, so I just send it with attachment not by “git send-email”. Of course there are still lots of further works should be done, I will go on to fix there. - *^_^* BRs, Juan ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
gtk-2-24-win32 branch update
The gtk-2-24-win32 branch is now in a pretty good state. I fixed a lot of bugs from bugzilla and stuff from dieters testing (https://live.gnome.org/GTK%2B/Win32/test-gtk-2-24-win32). I think this is in a state where we might want to merge it into master. I fixed most core issues, although I didn't fix the MS-Windows misrendering bugs that dieter pointed out. So, could everyone interested in the windows support test this please. I'd like to make a 2.24 release with this stuff in it so that we have a final Gtk2 with good win32 support. Obviously we don't want to have any bad regressions for existing Gtk win32 apps in this release, so *please* test stuff. My plan going forward is to mostly leave this code as-is (i.e. mostly working but no new features) and move towards fixing Gtk 3.x on win32. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: A GTK+ hackfest opportunity
On 11/01/2011 02:13 AM, Matthias Clasen wrote: We already have 2 other GNOME hackfest prospects for this weekend, one by the docs team (https://live.gnome.org/Hackfests/BrnoDocs2012) and one by the accessibility team. We are still investigating the details about room availability during and after the conference, but it should be possible to accomodate 10-12 GTK+ people. Possible topics for the GTK+ hackfest that I would like to see on the agenda: - a11y (use the synergy with the accessibility team next room) Some days ago I had a long IRC talk with Ryan. As far as I understood, room availability is an issue, so would be better to discard a co-located a11y hackfest (so probably this would lead to a specific a11y hackfest on January). Taking into account all this information, could you elaborate this accessibility team next room? Are you still supposing a co-located hackfest or just that would be good to have some a11y folks there? BR -- Alejandro Piñeiro Iglesias ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: A GTK+ hackfest opportunity
On Wed, Nov 2, 2011 at 12:42 PM, Piñeiro apinhe...@igalia.com wrote: Taking into account all this information, could you elaborate this accessibility team next room? Are you still supposing a co-located hackfest or just that would be good to have some a11y folks there? This was just 'a good opportunity', but you seem to have newer information than I do. Having the a11y hackfest separately also has some advantages. E.g. Benjamin might be able to attend both... ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: A GTK+ hackfest opportunity
On Wed, 2011-11-02 at 14:15 -0400, Matthias Clasen wrote: E.g. Benjamin might be able to attend both... This is really the issue. Having the gtk and a11y developers in the same place is great -- but totally useless unless Benjamin can focus on a11y while he's there. For that reason, plus the reasons of less required synchronisation (and the fact that Benjamin doesn't seem to mind the extra trip) the a11y hackfest was separated out. Cheers ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list