Re: identify unused functions?

2008-04-04 Thread Bernd Jendrissek
On Tue, Apr 1, 2008 at 12:06 AM, Brian J. Tarricone [EMAIL PROTECTED] wrote:
 G Hasse wrote:
   There is NO way to clerify all unused functions in a program.
   You could call functions by their addresses and those addresses
   could be calculated in runtime. So you don't know...

  This is especially important in a gtk program where most (if not all)
  signal callbacks will be passed to g_signal_connect() as a function
  pointer, and will never be called directly.

However, if the functions are in a (private) library, then you can
find unused functions by subtracting the output of objdump -R
$libdir/libfoo.so (get dynamic relocations) from the list of defined
functions (see Stefan's nm --defined-only trick).  The difference is a
list of functions that aren't used by the library itself.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Video overlay problem

2008-04-04 Thread Gabriele Greco
On 3/30/08, Colm Aengus Murphy [EMAIL PROTECTED] wrote:


 It looks like the video is being overlayed over all tabs.
 The only widget that it doesn't get overlayed on is a gtktextview widget.

 Any ideas on how I can ensure the video is only ever seen in its own tab ?


Add a GtkEventBox to the other tabs where the video should not be seen.

-- 
Bye,
 Gabry
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: TreeView indent-expanders style property

2008-04-04 Thread Kristian Rietveld
On Mon, Mar 24, 2008 at 03:50:29PM -0600, Jeffrey Barish wrote:
 Does anyone know what the indent-expanders style property does?
 
 Can I use indent-expanders to achieve this effect?  Is there a way to
 achieve it?  The point is to avoid wasting space on lines that don't
 require an expander arrow.

No, the indent-expanders style property will not be of use here.  What
the indent-expanders style property does is distinguish between

 Line 1
   Line 2
 Line 3
  Line 4

and this case:

 Line 1
Line 2
  Line 3
  Line 4

Avoiding wasting space for non-parent nodes is not something that is
supported by GtkTreeView by default.  If you really want to deviate from
the defaults here, the custom expander cell renderer route Thomas talks
about in his mail is probably your best bet.


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: GtkTreeView: GTK_SELECTION_SINGLE not working?

2008-04-04 Thread Carlos Pereira
Thanks for replying!

I certainly would be glad if proved wrong, but I see three problems here,
two are human interface issues, the other is a technical issue.


1) In GtkTreeview with GtkListStore, show always the first item as default,
when selection is SINGLE or BROWSE

Sometimes it makes sense to have a default, sometimes it doesn't.

If you are selecting fonts, it makes sense to show medium as default.

If you are selecting hotels for vacations, it makes no sense to have
a default. The first hotel for default? why? users will suspect that
you are pushing that hotel on them!

One of my lists contains crystallographic space groups. When showing
all of them they are 230. The first ones are not common in Nature. The
most found in metals, ceramics, minerals are, say the hexagonal and
cubic ones, which are the last ones in the list. Which group should I show
as default? The number 1, as GTK wants? it is a triclinic group, seldom used
in crystallographic work... most important in metals are groups 194, 
225, 229...
Clearly the best choice is: show no default, the user chooses!

In GTK_SELECTION_SINGLE there is always a default, for a GtkListStore,
and this default is the first item on the list. This is wrong! If I 
think that a default
should be set, I should be able to easily do it myself, not GTK for me!

Interestingly enough, when GtkTreeStore is used, then no default is set...
even for GTK_SELECTION_BROWSE! even when the tree nodes have no
child, so they behave exactly as list nodes (so the SAME lists produced
with TreeStore and ListStore behave differently...)

only when the user clicks, something is selected...

A simple workaround is to start with GTK_SELECTION_NONE,
and then change to GTK_SELECTION_BROWSE, after the window is shown.
This way no default is shown initialliy.

***
2) Click to select, Ctr Click to unselect

In computer interfaces, everytime we have two-state choices (up-down, 0-1,
yes-no, true-false), the solution should be: click to change the state. 
So if you are in
state 0, clicking takes you to state 1, clicking again takes you to 
state 0, and so on...

This is the way toogle and check buttons work. When you want to maximize a
window you click on the WM decorations, to restore the window you click 
again
on the same WM decorations. There are many examples of this...

Select/Unselect rows is clearly a two-state operation, from the point of 
view
of users, so it should work in the usual way: click to select, click 
again to
unselect, click again to select, exactly as in toogle and check buttons...

Clicking to select rows and Ctrl Clicking to unselect them, makes as 
much sense
as Clicking to toggle buttons, and Ctrl Clicking to untoggle them...
this is exactly the opposite of HIG common-sense guidelines...

*
3) In both GTK_SELECTION_SINGLE and GTK_SELECTION_BROWSE modes,
with a GtkListStore, this code gets the correct selection, when clicking 
on a row,
if you are NOT pressing Ctrl or Shift keys:

GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
char *name;

selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
if (gtk_tree_selection_get_selected (selection, model, iter))
  {
  gtk_tree_model_get (model, iter, 0, name, -1);
  printf (Selected: %s\n, name);
  free (name);
  }
else printf (Selected: None\n);

However, if you are pressing Ctrl or Shift, when selecting a different 
item, this code returns the PREVIOUS item, not the current one.

Please check this working example (as simple as possible, to show my point):
http://www.gamgi.org/treeview.c

If you click on Apples, the selection gets Apples. If you click on 
Bananas, the selection gets Bananas. But if you then do Ctrl click on 
Apples, the selection gets Bananas, not Apples!

Carlos

Kristian Rietveld wrote:
 Could you more precisely describe what you think is wrong?  I quickly
 tested with GTK+ trunk and I do not see any problems.  It is indeed the
 case that one row is basically always selected (both with single and
 browse mode) and the main difference between browse and single mode is
 that in browse mode you cannot use ctrl+click to unselect a row.  And
 this is something that does work and is possible in single selection
 mode.
   

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