Re: get position/coordinates of a widget



chabayo wrote:
Hello,

i have a tree/listview and as i press a special button i emit the signal "popup-menu".

Done that i get the cell coordinates in the Treeview...

gtk_tree_view_get_cell_area ( GTK_TREE_VIEW ( show_tables_treeview ) ,
    gtk_tree_model_get_path ( GTK_TREE_MODEL
    ( show_tables_treestore ) , &iter ) , gtk_tree_view_get_column
    ( GTK_TREE_VIEW ( show_tables_treeview ) , 0 ) , &area );

...and thought to get the coordinates of the Treeview...

gdk_window_get_position ( gtk_tree_view_get_bin_window
    ( GTK_TREE_VIEW ( show_tables_treeview ) ) , &con_x , &con_y );

...but that doesn't work.


Anyone knows me how to do?

What exactly are you trying to accomplish ?

All widgets store thier coordinates relative to the next
parent in the heirarchy that has its own GdkWindow in the
variable: `widget->allocation'.

A treeview is a GtkWidget (so it has an allocation)
A cell area is a "thing that has to do with a treeview", so its
an entirely different beast AFAIK.

Cheers,
                           -Tristan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]