Re: ComboBox and TreeStore
hi, you need to add the renderers! The ComboBox uses a tree model. Look how its done there. Stefan On 10:23:22 pm 09/11/2006 Mark Richardson [EMAIL PROTECTED] wrote: Having some difficulty with a combo box and associated tree store. When I do this, nothing shows up... GtkTreeStore *myTreeStore=gtk_tree_store_new(1, G_TYPE_STRING); GtkWidget *myComboBox=lookup_widget(mainWindow, myComboBox); gtk_combo_box_set_model(GTK_COMBO_BOX(myComboBox), GTK_TREE_MODEL(myTreeStore)); GtkTreeIter tempIter; gtk_tree_model_get_iter(GTK_TREE_MODEL(myTreeStore), tempIter); gtk_tree_store_append(myTreeStore, iter, NULL); gtk_tree_store_set(myTreeStore, iter, 0, test, -1); I ultimately want to make more than 1 column, and I need to change the tree store data on the fly. So I would like to use the treeStore instead of the default combo box new_text and append_text. Thanks for any help, Mark - Everyone is raving about the all-new Yahoo! Mail beta. ___ 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: GTK+ Draw a Rectangle over other widgets?
On 12:33:05 am 21/08/2006 Wolfman [EMAIL PROTECTED] wrote: @Stefan Can u tell me how to call the expose in simple example? You don call that, gtk+ calls that to ask the widget to redraw. See bt_sequence_view_expose_event() in http://buzztard.cvs.sourceforge.net/buzztard/buzztard/src/ui/edit/sequence-view.c?revision=1.23view=markup Stefan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: set default theme for a new display
Answering to my self. For now I don't run gtk+ tests in a forked environment. There seems to be some curruption/problem with the gdk_thread handing in this case. Stefan On 10:05:38 pm 03/08/2006 Stefan Kost [EMAIL PROTECTED] wrote: hi, for unit-tests I open a second display on a Xvfb server which I start before. This elaready works nicely. Now I also take screenshots from the test-runs, for the manuals. This combined with altering the envoronment (LC_ALL='en fr de ...') creates me localized screenshots. So far so good. The issue is that gtk+ uses the default theme on the new display. While the API docs are very sparse about how the theme stuff works, even reading the sources did not really help. Below is the code I use so far. As soon as I call gtk_settings_get_for_screen(default_screen); I get stuff like The program 'check_buzzard' received an X Window System error. This probably reflects a bug in the program. The error was 'BadRequest (invalid request code or no such operation)'. (Details: serial 96 error_code 1 request_code 0 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously;that is, you will receive the error a while after causing it.To debug your program, run it with the --sync command lineoption to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) Each test itself gets run in a fork(). If I add gdk_threads_leave(); ... gdk_threads_enter(); around if(gtk_settings_get_for_screen()) ... the application blocks :( Any idea? Stefan if((display_manager = gdk_display_manager_get())) { GdkScreen *default_screen; GtkSettings *default_settings; gchar *theme_name; default_display = gdk_display_manager_get_default_display(display_manager); if((default_screen = gdk_display_get_default_screen(default_display) )) { if((default_settings = gtk_settings_get_for_screen(default_screen) )) { g_object_get(default_settings,gtk-theme-name,theme_name,NULL) ; GST_INFO(current theme is \%s\,theme_name); //g_object_unref(default_settings); } else GST_WARNING(can't get default_settings); //g_object_unref(default_screen); } else GST_WARNING(can't get default_screen); if((test_display = gdk_display_open(display_name))) { GdkScreen *test_screen; GtkSettings *test_settings; if((test_screen = gdk_display_get_default_screen(test_display))) { if((test_settings = gtk_settings_get_for_screen(test_screen))) { g_object_set(test_settings,gtk-theme-name,theme_name,NULL); gtk_rc_reparse_all_for_settings(test_settings,TRUE); GST_INFO(theme switched ); //g_object_unref(test_settings); } else GST_WARNING(can't get test_settings on display: \%s\,display_name); //g_object_unref(test_screen); } else GST_WARNING(can't get test_screen on display: \%s\,display_name); gdk_display_manager_set_default_display(display_manager,test_displ ay); GST_INFO(display %p,\%s\ is active,test_display,gdk_display_get_name(test_display)); } else { GST_WARNING(failed to open display: \%s\,display_name); } g_free(theme_name); } else { GST_WARNING(can't get display-manager); } ___ 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: WG:_Toolbarbutton_nach_erstem_Betätigen_ina ktiv
hi, at first this list is english :) regarding the problme, can it be suses qt theme engine for gtk? what happens if you start a gnome desktop and start your app there. Stefan On 12:54:32 pm 27/06/2006 Vallario Brigitte [EMAIL PROTECTED] wrote: -Ursprüngliche Nachricht- Von: Vallario Brigitte Gesendet:Donnerstag, 1. Juni 2006 08:11 An:'[EMAIL PROTECTED]' Betreff:WG: Toolbarbutton nach erstem Betätigen inaktiv -Ursprüngliche Nachricht- Von: Vallario Brigitte Gesendet:Mittwoch, 31. Mai 2006 13:13 An:'[EMAIL PROTECTED]' Betreff:Toolbarbutton nach erstem Betätigen inaktiv Hallo, wer kann helfen? Seit der Version SuSE 9.3 mit KDE funktionieren die Toolbarbuttons nicht mehr richtig. Wenn ich z.B. bei einer Funktion Weiterblättern das erste mal mit der Maus draufgedrückt habe, muss ich mit der Maus erst wieder wegfahren - vom Button runter bewegen - und danach wieder auf den Button, damit ich diesen auslösen kann. So erzeuge ich die Toolbar im Hauptfenster: toolbar = gtk_toolbar_new(); gtk_toolbar_set_orientation( GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL ); gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS ); gtk_container_set_border_width( GTK_CONTAINER(toolbar), 1 ); Die Icons lade ich wie folgt hinein: iconp = gdk_pixbuf_new_from_file( icon, err ); if(err == NULL) { iconp = gdk_pixbuf_add_alpha (iconp,1,192,192,192) ; iconw = gtk_image_new_from_pixbuf (iconp) ; } button = gtk_toolbar_append_item( GTK_TOOLBAR(toolbar), g_locale_to_utf8( text, -1, NULL, NULL, NULL ), g_locale_to_utf8( tooltip, -1, NULL, NULL, NULL ), Private, iconw, GTK_SIGNAL_FUNC(m_gt_button_press)); ___ 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: noticing focus loss for a popup widnow
Just for the record, after a couple of weekends I've seem to figured it out myself. The solution is to do gtk_add_grab (also grab focus, keyboard and pointer). Then all events go to the widget that grabs and one can detect outside clicks. A good example is in rythmbox sources. Stefan On 11:56:51 pm 16/05/2006 Stefan Kost [EMAIL PROTECTED] wrote: hi, I use popup window (such as the one from the volume applet). When I click my items on the scren I show the volume popup (a window containing +/- buttons + a scale). I looks good and the buttons can be used. Now the problem is that I want to hide it when one clicks somewhere else (outside the popup). I've seen Ronald Bultje asking this in may 2005 for the volume applet and I've also looked at the code, but can't figure it out :( I've monitored focus, focus-out, move-focus events for the widnow to no avail. Any idea? Stefan ___ 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: interactive buttons inside treeview headings
Hi all, to make t more clear, its multiple items per header. Here comes some ascii art: +-+--+ - - | label1 | label2 | label3 | [B1][B2]| [B1][B2][B3] | ... +-+--+- - - So each treeview header widget is infact: vbox { label hbox { toggle_button1 toggle_button2 } } My guess is that gdk event are not reaching any content of my reeview header widget. Do I have to muck with the event_mask. Or do I need to install a callback for the generic event event on the treecolumn-button and somehow resend the received events to my header widgets? Stefan On 6:00:19 am 11/04/2006 Guy Rouillier [EMAIL PROTECTED] wrote: Stefan Kost wrote: hi list, I've added a couple of (toggle)-buttons and a label in a box into each of my treeview headers. They are shown properly. I can also modify them programatically (toggle). My problem is, that I can't click them. Honestly I have no idea how to debug this. Any idea? I'm not sure I understand your code, in particular what you mean by added a copule buttons and a label in a box into each of my treeview headers. The GtkTreeView widget provides a clickable header for you. Where are you putting your button and label in a box? At any rate, if you are using the standard GtkTreeView, here are the statements you need to get a clickable header that sorts: GtkTreeViewColumn *clmn = gtk_tree_view_column_new(); gtk_tree_view_column_set_title( clmn, Integer); gtk_tree_view_column_set_resizable( clmn, TRUE); gtk_tree_view_column_set_reorderable( clmn, TRUE); gtk_tree_view_column_set_sort_column_id( clmn, INT_COLUMN ); gtk_tree_view_column_set_sort_indicator( clmn, TRUE); GtkCellRenderer *rndr = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start( clmn, rndr, FALSE); gtk_tree_view_column_set_attributes(clmn, rndr, text, INT_COLUMN, NULL); gtk_tree_view_column_set_visible( clmn, TRUE); -- Guy Rouillier ___ 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