Re: HildonTouchSelector

2010-04-09 Thread Alberto Garcia
On Thu, Apr 08, 2010 at 06:11:15PM -0700, Aniello Del Sorbo wrote:

 HildonTouchSelector has methods to append/prepend items but none to
 remove them.
 GTK does.

Ok, I understand this is arguable, but since you can access the model
directly, I don't think HildonTouchSelector needs to provide extra
methods for all tree model operations.

Berto
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-09 Thread Alberto Garcia
On Thu, Apr 08, 2010 at 06:11:15PM -0700, Aniello Del Sorbo wrote:

  /* Get the path to row 0 */
  path = gtk_tree_path_new_from_string (0);
  
  /* Get the tree iter for that path */
  gtk_tree_model_get_iter (GTK_TREE_MODEL (model),
  iter, path);
  
  /* Do not need path anymore */
  gtk_tree_path_free (path);

Btw, you have

  gtk_tree_model_get_iter_first ()
  gtk_tree_model_iter_nth_child ()

which are easier to use.

Berto
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-09 Thread Aniello Del Sorbo
On 9 April 2010 02:18, Alberto Garcia agar...@igalia.com wrote:
 On Thu, Apr 08, 2010 at 10:38:26PM -0700, Aniello Del Sorbo wrote:

 I have a HildonPickerButton with a simple Selector with no Done
 button.

 With the trick below I can remove rows from the Selector, but then
 the PickerDialog does not properly resize itself, leaving some empty
 space below the Selector.

 Hmm... can you please file a bug about that? Thanks !

 Berto

Will do. I thought it was because of my weird access to the internal structure.
But, indeed, as the model is exposed to the outside, I should have
expected it to work.

Thanks

-- 
anidel
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-09 Thread Aniello Del Sorbo
On 9 April 2010 01:53, Alberto Garcia agar...@igalia.com wrote:
 On Thu, Apr 08, 2010 at 06:11:15PM -0700, Aniello Del Sorbo wrote:

 HildonTouchSelector has methods to append/prepend items but none to
 remove them.
 GTK does.

 Ok, I understand this is arguable, but since you can access the model
 directly, I don't think HildonTouchSelector needs to provide extra
 methods for all tree model operations.

 Berto

Indeed it is arguable, but as GTK already provides it and because a
toolkit should make developer's life easier, it would have been nice
to find a remove function as well even though it wasn't needed for
internal developers.

-- 
anidel
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-09 Thread Aniello Del Sorbo
On 9 April 2010 02:14, Alberto Garcia agar...@igalia.com wrote:
 On Thu, Apr 08, 2010 at 06:11:15PM -0700, Aniello Del Sorbo wrote:

      /* Get the path to row 0 */
      path = gtk_tree_path_new_from_string (0);
 
      /* Get the tree iter for that path */
      gtk_tree_model_get_iter (GTK_TREE_MODEL (model),
                      iter, path);
 
      /* Do not need path anymore */
      gtk_tree_path_free (path);

 Btw, you have

  gtk_tree_model_get_iter_first ()
  gtk_tree_model_iter_nth_child ()

 which are easier to use.

 Berto

True.
It was simply the first solution I came up with, with my limited
knowledge of GTK and it's tools

Thanks for everything though :)

-- 
anidel
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


HildonTouchSelector

2010-04-08 Thread Aniello Del Sorbo
Hi,

just a note.

HildonTouchSelector has methods to append/prepend items but none to
remove them.
GTK does.

Anyway.. no idea why Hildon does not provide it, but if you ever want to
remove a particular row from a HildonTouchSelector this is a starting
point (of course it's very raw):

/* Assuming you want to remove row 0 or column 0 */


 GtkTreeModel *model;
 GtkTreePath *path;
 GtkTreeIter iter;
 
 /* Get the tree model of column 0 */
 model = hildon_touch_selector_get_model (HILDON_TOUCH_SELECTOR(layerbox), 
 0);
 
 /* Get the path to row 0 */
 path = gtk_tree_path_new_from_string (0);
 
 /* Get the tree iter for that path */
 gtk_tree_model_get_iter (GTK_TREE_MODEL (model),
 iter, path);
 
 /* Do not need path anymore */
 gtk_tree_path_free (path);
 
 /* Finally remove the entry from the list */
 gtk_list_store_remove (GTK_LIST_STORE (model), iter);
 

Hope this helps someone.

Aniello

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-08 Thread Aniello Del Sorbo
On Thu, 2010-04-08 at 18:11 -0700, Aniello Del Sorbo wrote:

 /* Assuming you want to remove row 0 or column 0 */

Errata:

/* Assuming you want to remove row 0 from column 0 */

Aniello

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector

2010-04-08 Thread Aniello Del Sorbo
Uhm,

I have a HildonPickerButton with a simple Selector with no Done button.

With the trick below I can remove rows from the Selector, but then the
PickerDialog does not properly resize itself, leaving some empty space
below the Selector.

I need to resize the HildonPickerDialog, any idea how?

An ugly (very) trick is to destroy the HildonPickerDialog that the
HildonPickerButton creates internally.
Yeah, exactly, internally.. don't want to do that, and there should be
no reason to do that.

However gtk_widget_queue_resize on the Selector doesn't give any
effect (and that's correct, as it's the Dialog that has the wrong
size). But I do not have access to it...

Suggestions?

On 8 April 2010 18:21, Aniello Del Sorbo ani...@gmail.com wrote:
 On Thu, 2010-04-08 at 18:11 -0700, Aniello Del Sorbo wrote:

 /* Assuming you want to remove row 0 or column 0 */

 Errata:

 /* Assuming you want to remove row 0 from column 0 */

 Aniello





-- 
anidel
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


HildonTouchSelector and visible rows

2010-03-15 Thread Nicolai Hess
Hi,

I made a home widget for maemo5. The settings dialog should show a
HildonTouchSelector with some entries where the use can select one.
I don't know how to configure HildonTouchSelector to make more than
one row visible. At the moment the dialog (created with
gtk_dialog_new_with_buttons)
shows one button, to confirm selection, on the right side and only one row
of the HildonTouchSelector
on the left side.

Anyone knows how to set the size for the touchselector or knows an example
where I can
look at.

regards nicolai
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector and visible rows

2010-03-15 Thread Claudio Saavedra
El lun, 15-03-2010 a las 10:13 +0100, Nicolai Hess escribió:
 Hi,
 
 I made a home widget for maemo5. The settings dialog should show a
 HildonTouchSelector with some entries where the use can select one.
 I don't know how to configure HildonTouchSelector to make more than 
 one row visible. At the moment the dialog (created with
 gtk_dialog_new_with_buttons)
 shows one button, to confirm selection, on the right side and only one
 row of the HildonTouchSelector
 on the left side. 

Try with HildonPickerDialog. It's specially meant to be used with a
touchselector.

There are plenty of examples in the hildon-examples package, as well.

Claudio



___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector and visible rows

2010-03-15 Thread Nicolai Hess
2010/3/15 Claudio Saavedra csaave...@igalia.com

 El lun, 15-03-2010 a las 10:13 +0100, Nicolai Hess escribió:
  Hi,
 
  I made a home widget for maemo5. The settings dialog should show a
  HildonTouchSelector with some entries where the use can select one.
  I don't know how to configure HildonTouchSelector to make more than
  one row visible. At the moment the dialog (created with
  gtk_dialog_new_with_buttons)
  shows one button, to confirm selection, on the right side and only one
  row of the HildonTouchSelector
  on the left side.

 Try with HildonPickerDialog. It's specially meant to be used with a
 touchselector.

 There are plenty of examples in the hildon-examples package, as well.

 Claudio



 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers


I came across the HildonPickerButton, but I didn't want to show
the user an extra button just to open another dialog. But of course, I just
can use
the HildonPickerDialog without a PickerButton :-)
Thank you.
nicolai
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: HildonTouchSelector and visible rows

2010-03-15 Thread Piñeiro
From: Nicolai Hess nicolaih...@web.de

 Anyone knows how to set the size for the touchselector or knows an example
 where I can
 look at.

There are a package called libhildon1-examples, with several examples
of hildon widgets, including the HildonTouchSelector.

You can also see these examples downloading directly the library:

git clone git://gitorious.org/hildon/hildon.git

BR

===
API (apinhe...@igalia.com)
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: row-activate signal for HildonTouchSelector

2010-01-14 Thread Piñeiro
From: Neal H. Walfield n...@walfield.org

Sorry for the delay.

 I want to use the HildonTouchSelector widget to enable the user to
 select an item from a list.  I want an action to occur when the user
 clicks on an item.  I don't want the user to have to press another
 button.
 
 The HildonTouchSelector widget provides a changed signal.  This is
 emtited when the active item changes.  This appears to be due to the
 user selecting an item (even the preselected one) or an item (perhaps
 the active item?) in the model changing via, e.g., a row-changed
 signal.

GtkTreeModel::row-changed can be a cause of the emission of
HildonTouchSelector::changed, but normally the emission of the signal
is due GtkTreeView::row-tapped. This signal is emitted each time the
user tap on one of the GtkTreeView rows.

 I need to distinguish between these two cases.  I only want to act if
 the user actually clicked on an item.  That is, I want the behavior
 that the media player implements, e.g., in its select artist view.
 Will someone please suggest how to best achieve this?

HildonTouchSelector::changed is more related to
GtkTreeSelection::changed that to row-changed. Similarly to
GtkTreeSelection::changed [1] this is basically a hint, although we
try to be more strict. As far as I know the only misleading
behaviour is this one, that the signal could be emitted when the
although the value selected has no really changed.

One option you have is save the previous selection before that, and
then compare the value selected with the user with the previous
selection.

BR

[1] 
http://library.gnome.org/devel/gtk/stable/GtkTreeSelection.html#GtkTreeSelection-changed

===
API (apinhe...@igalia.com)
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


row-activate signal for HildonTouchSelector

2010-01-04 Thread Neal H. Walfield
I want to use the HildonTouchSelector widget to enable the user to
select an item from a list.  I want an action to occur when the user
clicks on an item.  I don't want the user to have to press another
button.

The HildonTouchSelector widget provides a changed signal.  This is
emtited when the active item changes.  This appears to be due to the
user selecting an item (even the preselected one) or an item (perhaps
the active item?) in the model changing via, e.g., a row-changed
signal.

I need to distinguish between these two cases.  I only want to act if
the user actually clicked on an item.  That is, I want the behavior
that the media player implements, e.g., in its select artist view.
Will someone please suggest how to best achieve this?

Thanks,

Neal
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: row-activate signal for HildonTouchSelector

2010-01-04 Thread Neal H. Walfield
At Mon, 04 Jan 2010 13:58:52 +0100,
Neal H. Walfield wrote:
 
 I want to use the HildonTouchSelector widget to enable the user to
 select an item from a list.  I want an action to occur when the user
 clicks on an item.  I don't want the user to have to press another
 button.
 
 The HildonTouchSelector widget provides a changed signal.  This is
 emtited when the active item changes.  This appears to be due to the
 user selecting an item (even the preselected one) or an item (perhaps
 the active item?) in the model changing via, e.g., a row-changed
 signal.
 
 I need to distinguish between these two cases.  I only want to act if
 the user actually clicked on an item.  That is, I want the behavior
 that the media player implements, e.g., in its select artist view.
 Will someone please suggest how to best achieve this?

After some investigation, it seems that setting the
HildonTouchSelector widget to be in HILDON_UI_MODE_NORMAL causes
changed to exhibit the above behavior.

I now have a new problem.  When calling
hildon_touch_seletor_select_iter, the changed signal is emitted but
hildon_touch_selector_get_last_activated_row does not reflect the
newly selected row.  Any ideas?

Thanks,

Neal

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: row-activate signal for HildonTouchSelector

2010-01-04 Thread Neal H. Walfield
At Mon, 04 Jan 2010 16:56:17 +0100,
Neal H. Walfield wrote:
 After some investigation, it seems that setting the
 HildonTouchSelector widget to be in HILDON_UI_MODE_NORMAL causes
 changed to exhibit the above behavior.
 
 I now have a new problem.  When calling
 hildon_touch_seletor_select_iter, the changed signal is emitted but
 hildon_touch_selector_get_last_activated_row does not reflect the
 newly selected row.  Any ideas?

In case someone is interested in the resolution of this, I've reported
this as bug #7648.

https://bugs.maemo.org/show_bug.cgi?id=7648

Neal


___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers