GTK+ Warning: Can't set a parent on widget which has a parent!!

2011-06-03 Thread Phong Cao
Hello everybody,

I am trying to write the interface for my music manager using GTK+. The
program was compiled successfully. However, when I executed it, the machine
returned errors:

(dingo_draft:6462): Gtk-WARNING **: Can't set a parent on widget which
has a parent(dingo_draft:6462): Gtk-CRITICAL **: gtk_widget_realize:
assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)'
failed**Gtk:ERROR:/build/buildd/gtk+2.0-2.20.1/gtk/gtkwidget.c:8760:gtk_widget_real_map:
assertion failed: (gtk_widget_get_realized (widget))Aborted

Attached with this email is the source code of the program. Please note that
this is *just the interface written in GTK+*. I did not add any signals in
yet. I think there might be some problems with the GTK+ functions, but I
could not locate where the errors occured.

Thank you for helping me with this problem!! Hope you guys have a good
weekend!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gail next steps (was Re: GTK and ATK)

2011-06-03 Thread Matthias Clasen
On Wed, Jun 1, 2011 at 7:48 PM, PiƱeiro apinhe...@igalia.com wrote:
 On 05/10/2011 04:28 PM, Benjamin Otte wrote:

 In fact, IMHO, some of the issues pointed by Benjamin would be solved by
 this [2] and the gail migration, but lets not talk about it. As I said,
 those are long term tasks, and the fact is that the current accessibility
 status needs to be improved also in the short and medium term.

 I also planned to define those short-medium tasks, but after reading again
 some mails, Matthias already did it in this mail [3], so I will not repeat
 that. I will just include that as task 1.5 I would include refactoring
 gailtreeview, one of the big problems related to performance that prevents
 having a11y enabled as default [5]

For making things work better in the short/medium term (ie before we
land a complete refactoring/rewrite of gail), I think two things are
essential:

1. Define the atk interfaces to a testable level.

One example that I have run in recently is
the 'name' property of AtkObject - it is not really defined at all
what this is supposed to contain, and how it is supposed to be used.
It turns out a change that I committed last September made menu
accessibles not have names - it turns out that that breaks ATs which
expected those names to be taken out of the labels contained in the
menuitems. This needs to be specified somewhere, so that we can then

2. Test that the accessible implementations actually follow that spec.

I want to be able to have a unit test in the GTK+ repository that
instantiates a widget, gets the corresponding accessible, and then
verifies that it has the expected properties. If we had such
testcases, it would not have taken 9 months from me committing the
breaking change to me committing the fix. On the other hand, the fact
that nobody filed a bug maybe tells us something about the amount of
real-life usage that the gnome3 accessibility stack currently gets...
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: www.gtk.org now updated but no news!

2011-06-03 Thread Devin Samarin
I have hopefully fixed this problem (I can't test with older versions
of PHP, but I have tested the new function by itself, and in theory it
will work.)

Patch is located here: https://bugzilla.gnome.org/show_bug.cgi?id=651807

I also cleaned up some code used during development of the website.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


GTK+ Warning: Can't set a parent on widget which has a parent

2011-06-03 Thread Phong Cao
Hello everybody,

I am trying to write the interface for my music manager using GTK+. The
program was compiled successfully. However, when I executed it, the machine
returned errors:

(dingo_draft:6462): Gtk-WARNING **: Can't set a parent on widget which
has a parent(dingo_draft:6462): Gtk-CRITICAL **: gtk_widget_realize:
assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)'
failed**Gtk:ERROR:/build/buildd/gtk+2.0-2.20.1/gtk/gtkwidget.c:8760:gtk_widget_real_map:
assertion failed: (gtk_widget_get_realized (widget))Aborted

Attached with this email is the source code of the program. Please note that
this is *just the interface written in GTK+*. I did not add any signals in
yet. I think there might be some problems with the GTK+ functions, but I
could not locate where the errors occured.

Thank you for helping me with this problem!! Hope you guys have a good
weekend!
/* This is the interface design draft for the media player
/* This does not include the signals for widgets. Just a plain draft */

#include gtk/gtk.h

int main(int argc, char *argv[]) {
  /* Initialize gtk+  gstreamer */
  gtk_init(argc, argv);

  /* Create mainwindow (mainwindow) */
  GtkWidget *mainwindow;
  
  mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(mainwindow), Music Manager);
  
  /* Create the vbox containing searchbox  song list (treevbox) */
  GtkWidget *searchbox, *treesong, *scrollsong, *treevbox;
  GtkCellRenderer *namerender, *timerender;

  treesong = gtk_tree_view_new();
  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treesong), FALSE);

  namerender = gtk_cell_renderer_text_new();
  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treesong), -1, Songs, namerender, text, 0, NULL);
  
  timerender = gtk_cell_renderer_text_new();
  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treesong), -1, Time, timerender, text, 1, NULL);
  
  /* some problem here */
  scrollsong = gtk_scrolled_window_new(NULL, NULL);  
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollsong), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrollsong), treesong);
  
  searchbox = gtk_entry_new();
  
  treevbox = gtk_vbox_new(TRUE, 0);
  gtk_box_pack_start_defaults(GTK_BOX(treevbox), searchbox);
  gtk_box_pack_start_defaults(GTK_BOX(treevbox), scrollsong);
  
  /* Create the song info section (infohbox) */
  GtkWidget *songname, *songinfo, *coverart;
  GtkWidget *infohbox, *imagevbox;
  
  coverart = gtk_image_new_from_file(music-notes.png);
  songname = gtk_label_new(iSong Name/i);
  songinfo = gtk_label_new(bArtist:/b \n bTrack/b \n bAlbum/b \n bYear/b \n bGenre/b \n bRating/b);
  
  infohbox = gtk_hbox_new(TRUE, 0);
  imagevbox = gtk_vbox_new(TRUE, 0);
  
  gtk_box_pack_start_defaults(GTK_BOX(imagevbox), coverart);
  gtk_box_pack_start_defaults(GTK_BOX(imagevbox), songname);
  gtk_box_pack_start_defaults(GTK_BOX(infohbox), imagevbox);
  gtk_box_pack_start_defaults(GTK_BOX(infohbox), songinfo);
  
  /* Create drawing area for video display (previewarea) */
  GtkWidget *previewarea;
  
  previewarea = gtk_drawing_area_new();
  gtk_widget_set_size_request(previewarea, 300, 200);
  
  /* Create actions tree view (ltreeview) */
  enum {
COL_ICON = 0,
COL_ACTION,
NUM_COLS
  };
  
  GtkCellRenderer *lrenderer;
  GtkTreeModel *lmodel;
  GtkWidget *ltreeview;
  GtkListStore *lliststore;
  GtkTreeIter liter;
  
  ltreeview = gtk_tree_view_new();
  
  lrenderer = gtk_cell_renderer_pixbuf_new();
  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(ltreeview), -1, Icon, lrenderer, pixbuf, COL_ICON, NULL);
  
  lrenderer = gtk_cell_renderer_text_new();
  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(ltreeview), -1, Actions, lrenderer, text, COL_ACTION, NULL);
  
  lliststore = gtk_list_store_new(NUM_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
  
  gtk_list_store_append(lliststore, liter);
  gtk_list_store_set(lliststore, liter, COL_ICON, gdk_pixbuf_new_from_file(now-playing.png, NULL), COL_ACTION, Now Playing, -1);

  gtk_list_store_append(lliststore, liter);
  gtk_list_store_set(lliststore, liter, COL_ICON, gdk_pixbuf_new_from_file(music.png, NULL), COL_ACTION, Music, -1);
  
  gtk_list_store_append(lliststore, liter);
  gtk_list_store_set(lliststore, liter, COL_ICON, gdk_pixbuf_new_from_file(video.png, NULL), COL_ACTION, Videos, -1);
  
  gtk_list_store_append(lliststore, liter);
  gtk_list_store_set(lliststore, liter, COL_ICON, gdk_pixbuf_new_from_file(playlist.png, NULL), COL_ACTION, Playlists, -1);
  
  lmodel = GTK_TREE_MODEL(lliststore);
  
  gtk_tree_view_set_model(GTK_TREE_VIEW(ltreeview), lmodel);
  
  /* g_object_unref(lmodel); */
  
  /* Create the top control bar (controlhbox) */
  GtkWidget *prevbutton, *nextbutton, *hscale, *cursong;
  GtkWidget *curpos, *duration, *volumebutton, *playbutton;
  GtkAdjustment *progress, *volumeadj;
  GtkWidget *buttonhbox, *proghbox, *infovbox, 

Re: GTK+ Warning: Can't set a parent on widget which has a parent

2011-06-03 Thread Chris Vine
On Fri, 3 Jun 2011 04:08:22 -0400
Phong Cao phn...@gmail.com wrote:
 Hello everybody,
 
 I am trying to write the interface for my music manager using GTK+.
 The program was compiled successfully. However, when I executed it,
 the machine returned errors:
 
 (dingo_draft:6462): Gtk-WARNING **: Can't set a parent on widget which
 has a parent(dingo_draft:6462): Gtk-CRITICAL **: gtk_widget_realize:
 assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)'
 failed**Gtk:ERROR:/build/buildd/gtk+2.0-2.20.1/gtk/gtkwidget.c:8760:gtk_widget_real_map:
 assertion failed: (gtk_widget_get_realized (widget))Aborted

I have no idea if it causes your problem (probably not), but you insert
a tree view into a scrolled window using gtk_container_add(), not
gtk_scrolled_window_add_with_viewport().

Chris
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK+ Warning: Can't set a parent on widget which has a parent

2011-06-03 Thread Nicola Fontana
Il giorno Fri, 3 Jun 2011 04:08:22 -0400
Phong Cao phn...@gmail.com ha scritto:

 Hello everybody,
 
 I am trying to write the interface for my music manager using GTK+. The
 program was compiled successfully. However, when I executed it, the machine
 returned errors:
 
 (dingo_draft:6462): Gtk-WARNING **: Can't set a parent on widget which
 has a parent

Hi Phong,

you are adding songinfo to infohbox and to vpaned. Choose a single container
or duplicate the widget.

Ciao.
-- 
Nicola
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


About client-event signal in GTK+-3.0

2011-06-03 Thread sy198704


Hi,
I want to known how use the client-event in the GTK+-3.0 ?
In GTK+-3.0 there is no client-event signal, so how can I recieve this event 
send from other
application.___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK+ Warning: Can't set a parent on widget which has a parent

2011-06-03 Thread Phong Cao
Thank you Nicola. I finally got it fixed! Yeah I did not pay attention to
the parents of songinfo...

On Fri, Jun 3, 2011 at 6:08 AM, Nicola Fontana n...@entidi.it wrote:

 Il giorno Fri, 3 Jun 2011 04:08:22 -0400
 Phong Cao phn...@gmail.com ha scritto:

  Hello everybody,
 
  I am trying to write the interface for my music manager using GTK+. The
  program was compiled successfully. However, when I executed it, the
 machine
  returned errors:
 
  (dingo_draft:6462): Gtk-WARNING **: Can't set a parent on widget which
  has a parent

 Hi Phong,

 you are adding songinfo to infohbox and to vpaned. Choose a single
 container
 or duplicate the widget.

 Ciao.
 --
 Nicola

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: About client-event signal in GTK+-3.0

2011-06-03 Thread Emmanuele Bassi
On 2011-06-03 at 19:29, sy198704 wrote:
 I want to known how use the client-event in the GTK+-3.0 ?
 In GTK+-3.0 there is no client-event signal, so how can I recieve this 
 event send from other
 application.

you can read the migration guide:

  http://developer.gnome.org/gtk3/stable/ch25s02.html#id1331806

the only backend using client events was the x11 backend anyway, so now
you get to use X11 API.

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list