Re: Python + hildon.TouchSelector (with pixbufs)
El dom, 30-08-2009 a las 15:35 -0400, Brent Chiodo escribió: The reason I'm creating the dialog by hand is because I want complete control over it's look and feel. Complete control on look 'n feel is not a good reason imho. HildonPickerButton + HildonTouchSelector is the recomended way to go, since by using them you'll get a look 'n feel that's standard with other applications in Maemo 5. In addition, hildon.PickerButton.set-image() is not working here so i thought it's probably best to use plain old GTK. That method is supposed to set an image on the button itself, I suppose this is what you need. Why is it not working? Claudio ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
On Sun, Aug 30, 2009 at 12:20 PM, Brent Chiodobchi...@gmail.com wrote: I'm trying to create a simple dialog that opens when you tap a button. In this dialog, I want to place in it a hildon.TouchSelector that has a single column comprised of pixbufs (logos of websites). Just to see if I could get a TouchSelector working, I created a simple one that just uses text labels instead of pixbufs. Here is the pertinent part of the code: # This part is the button that opens the dialog self.select_button = gtk.Button() self.select_icon = gtk.gdk.pixbuf_new_from_file_at_size(/usr/share/touchsearch/select_search_engine.png, 40, 40) self.select_image = gtk.Image() self.select_image.set_from_pixbuf(self.select_icon) self.select_image.set_padding(settings['padding'], settings['padding']) self.select_button.set_image(self.select_image) self.select_button.connect(clicked, self.select_engine_dialog) self.select_button.show_all() ... # And this is the dialog with the Touchselector in it def select_engine_dialog(self, widget): dialog = gtk.Dialog(Select A Site To Search, None, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR) close_button = dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) selector = hildon.hildon_touch_selector_new_text() I still need to try out your example here (it would be nice if you could give a more complete , even minimal one, showing the problem). But one thing I can see is that you should use this instead of the line above: selector = hildon.TouchSelector(text=True) Unfortunately, it seems that for some reason the text attribute was only added to the garage SVN (there should have been a 0.9.0-1maemo11 fixing this), I'll upload the updated version still today. Thanks, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
On Mon, Aug 31, 2009 at 7:13 AM, Anderson Lizardoanderson.liza...@openbossa.org wrote: On Sun, Aug 30, 2009 at 12:20 PM, Brent Chiodobchi...@gmail.com wrote: selector = hildon.hildon_touch_selector_new_text() I still need to try out your example here (it would be nice if you could give a more complete , even minimal one, showing the problem). But one thing I can see is that you should use this instead of the line above: selector = hildon.TouchSelector(text=True) Unfortunately, it seems that for some reason the text attribute was only added to the garage SVN (there should have been a 0.9.0-1maemo11 fixing this), I'll upload the updated version still today. Done. Brent, can you try the python-hildon 0.9.0-1maemo11 version ? remembering to change the constructor call as described above. Regards, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
@ Claudio I just tried it with a PickerButton and it does work quite nicely, so I think I'll switch to that. The only issue with the PickerButton is I can't get .set_image() to work with it -- no matter what I do it just appears this turquoise/blue-green color. I think it may have something to do with the first argument of the PickerButton. Right now I'm initiating the PickerButton like: button = hildon.PickerButton(40, hildon.BUTTON_ARRANGEMENT_VERTICAL) But, maybe it should be: self.select_button = hildon.PickerButton(hildon.SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) ...the problem is SIZE_AUTO doesn't exist. On Mon, Aug 31, 2009 at 9:07 AM, Anderson Lizardo anderson.liza...@openbossa.org wrote: On Mon, Aug 31, 2009 at 7:13 AM, Anderson Lizardoanderson.liza...@openbossa.org wrote: On Sun, Aug 30, 2009 at 12:20 PM, Brent Chiodobchi...@gmail.com wrote: selector = hildon.hildon_touch_selector_new_text() I still need to try out your example here (it would be nice if you could give a more complete , even minimal one, showing the problem). But one thing I can see is that you should use this instead of the line above: selector = hildon.TouchSelector(text=True) Unfortunately, it seems that for some reason the text attribute was only added to the garage SVN (there should have been a 0.9.0-1maemo11 fixing this), I'll upload the updated version still today. Done. Brent, can you try the python-hildon 0.9.0-1maemo11 version ? remembering to change the constructor call as described above. Regards, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil I upgraded python-hildon and tried using the method you suggested, but it still doesn't scroll. If you really need a working test-case to fix this then I'll write one. It's just that I came across the issue while deep in coding a Desktop Widget, and that is not exactly the ideal test-case. -- Best Regards, Brent Chiodo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
On Mon, Aug 31, 2009 at 12:29 PM, Brent Chiodobchi...@gmail.com wrote: @ Claudio I just tried it with a PickerButton and it does work quite nicely, so I think I'll switch to that. The only issue with the PickerButton is I can't get .set_image() to work with it -- no matter what I do it just appears this turquoise/blue-green color. I think it may have something to do with the first argument of the PickerButton. Right now I'm initiating the PickerButton like: button = hildon.PickerButton(40, hildon.BUTTON_ARRANGEMENT_VERTICAL) But, maybe it should be: self.select_button = hildon.PickerButton(hildon.SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) ...the problem is SIZE_AUTO doesn't exist. try gtk.HILDON_SIZE_AUTO (yeah, SIZE_AUTO comes from GTK, even on C...) I upgraded python-hildon and tried using the method you suggested, but it still doesn't scroll. If you really need a working test-case to fix this then I'll write one. It's just that I came across the issue while deep in coding a Desktop Widget, and that is not exactly the ideal test-case. actually, I can't reproduce your issue without a minimal test or even a screenshot/video showing the problem... I need something that I can check what the problem is, and after fixing it, verify the fix worked. Thanks, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
On Mon, Aug 31, 2009 at 1:49 PM, Anderson Lizardo anderson.liza...@openbossa.org wrote: On Mon, Aug 31, 2009 at 12:29 PM, Brent Chiodobchi...@gmail.com wrote: @ Claudio I just tried it with a PickerButton and it does work quite nicely, so I think I'll switch to that. The only issue with the PickerButton is I can't get .set_image() to work with it -- no matter what I do it just appears this turquoise/blue-green color. I think it may have something to do with the first argument of the PickerButton. Right now I'm initiating the PickerButton like: button = hildon.PickerButton(40, hildon.BUTTON_ARRANGEMENT_VERTICAL) But, maybe it should be: self.select_button = hildon.PickerButton(hildon.SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) ...the problem is SIZE_AUTO doesn't exist. try gtk.HILDON_SIZE_AUTO (yeah, SIZE_AUTO comes from GTK, even on C...) Hmm, .set_image() still isn't working... I upgraded python-hildon and tried using the method you suggested, but it still doesn't scroll. If you really need a working test-case to fix this then I'll write one. It's just that I came across the issue while deep in coding a Desktop Widget, and that is not exactly the ideal test-case. actually, I can't reproduce your issue without a minimal test or even a screenshot/video showing the problem... I need something that I can check what the problem is, and after fixing it, verify the fix worked. Thanks, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil I wrote a test-case using a PickerButton in a hildon.Window() and it worked fine so I created a simple HomePlugin that shows the problem (.py and .desktop attached). Let me know if you nee anything else. Thanks. -- Best Regards, Brent Chiodo import gobject import gtk import hildondesktop import hildon class Example(hildondesktop.HomePluginItem): __gtype_name__ = 'Example' def __init__(self): hildondesktop.HomePluginItem.__init__(self) button = hildon.PickerButton(gtk.HILDON_SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL) selector = hildon.TouchSelector(text=True) example = [1, 2, 3, 4, 5, 6, 7] for i in example: selector.append_text(i) button.set_selector(selector) button.set_selector(selector) button.show_all() self.add(button) def hd_plugin_get_object(): return gobject.new(Example, plugin_id=example) if __name__ == __main__: obj = hd_plugin_get_object() obj.show_all() gtk.main() example.desktop Description: Binary data ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
On Mon, Aug 31, 2009 at 02:33:44PM -0400, Brent Chiodo wrote: Hmm, .set_image() still isn't working... Are the Python bindings using .set_image() from HildonButton? Unfortunately, GtkButton's set_image() is not virtual, cannot be overriden and is useless for buttons with layouts different from the standard one (that includes HildonButton and its subclasses, such as HildonPickerButton). Berto ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
I don't know what the Python Bindings are using .set_image() from, but it's certainly not working with hildon buttons. On Mon, Aug 31, 2009 at 2:52 PM, Alberto Garcia agar...@igalia.com wrote: On Mon, Aug 31, 2009 at 02:33:44PM -0400, Brent Chiodo wrote: Hmm, .set_image() still isn't working... Are the Python bindings using .set_image() from HildonButton? Unfortunately, GtkButton's set_image() is not virtual, cannot be overriden and is useless for buttons with layouts different from the standard one (that includes HildonButton and its subclasses, such as HildonPickerButton). Berto ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers -- Best Regards, Brent Chiodo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Python + hildon.TouchSelector (with pixbufs)
I'm trying to create a simple dialog that opens when you tap a button. In this dialog, I want to place in it a hildon.TouchSelector that has a single column comprised of pixbufs (logos of websites). Just to see if I could get a TouchSelector working, I created a simple one that just uses text labels instead of pixbufs. Here is the pertinent part of the code: # This part is the button that opens the dialog self.select_button = gtk.Button() self.select_icon = gtk.gdk.pixbuf_new_from_file_at_size(/usr/share/touchsearch/select_search_engine.png, 40, 40) self.select_image = gtk.Image() self.select_image.set_from_pixbuf(self.select_icon) self.select_image.set_padding(settings['padding'], settings['padding']) self.select_button.set_image(self.select_image) self.select_button.connect(clicked, self.select_engine_dialog) self.select_button.show_all() ... # And this is the dialog with the Touchselector in it def select_engine_dialog(self, widget): dialog = gtk.Dialog(Select A Site To Search, None, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR) close_button = dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) selector = hildon.hildon_touch_selector_new_text() searches = [Google, eBay, Amazon, Merriam-Webster, Google Maps, Google Images, maemo.org] for i in searches: selector.append_text(i) dialog.vbox.add(selector) dialog.show_all() response = dialog.run() dialog.destroy() When I run this example I get exactly what I expected except the TouchSelector doesn't scroll -- when I drag it in either direction it shows me the indicator of where the focus is, but it doesn't move. Errors from traceback are: /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonPannableAreaMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_enum: assertion `G_TYPE_IS_ENUM (enum_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonMovementMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonSizeRequestPolicy' In addition to that, once I get that working how would I go about getting pixbufs in there instead of just text? I'm familiar with how to create a gtk.TreeView, but don't know how to apply this knowledge to a Touchelector e.g. the example found here: http://pymaemo.garage.maemo.org/documentation/python_hildon_tutorial/html/ch-Selectors.html#example-of-a-selector-with-a-custom-column ...doesn't work. TIA. -- Best Regards, Brent Chiodo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
El dom, 30-08-2009 a las 12:20 -0400, Brent Chiodo escribió: I'm trying to create a simple dialog that opens when you tap a button. In this dialog, I want to place in it a hildon.TouchSelector that has a single column comprised of pixbufs (logos of websites). For this use case, I'd recommend you using directly a HildonPickerButton instead of creating a button, a dialog, and all the logic by hand. Check the docs for HildonPickerbutton. Just to see if I could get a TouchSelector working, I created a simple one that just uses text labels instead of pixbufs. Here is the pertinent part of the code: # This part is the button that opens the dialog self.select_button = gtk.Button() self.select_icon = gtk.gdk.pixbuf_new_from_file_at_size(/usr/share/touchsearch/select_search_engine.png, 40, 40) self.select_image = gtk.Image() self.select_image.set_from_pixbuf(self.select_icon) self.select_image.set_padding(settings['padding'], settings['padding']) self.select_button.set_image(self.select_image) self.select_button.connect(clicked, self.select_engine_dialog) self.select_button.show_all() ... # And this is the dialog with the Touchselector in it def select_engine_dialog(self, widget): dialog = gtk.Dialog(Select A Site To Search, None, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR) close_button = dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) selector = hildon.hildon_touch_selector_new_text() searches = [Google, eBay, Amazon, Merriam-Webster, Google Maps, Google Images, maemo.org] for i in searches: selector.append_text(i) dialog.vbox.add(selector) dialog.show_all() response = dialog.run() dialog.destroy() When I run this example I get exactly what I expected except the TouchSelector doesn't scroll -- when I drag it in either direction it shows me the indicator of where the focus is, but it doesn't move. Errors from traceback are: /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonPannableAreaMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_enum: assertion `G_TYPE_IS_ENUM (enum_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonMovementMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonSizeRequestPolicy' I am not familiar with the python bindings, so I have not much to say about these errors other than it seems that the registration of some of the types fail, which is strange.. In addition to that, once I get that working how would I go about getting pixbufs in there instead of just text? I'm familiar with how to create a gtk.TreeView, HildonTouchSelector uses HildonTouchSelectorColumn for each of its columns. Since you want one single column, you need to create one and use the GtkCellLayout interface in the same way you would do for GtkTreeViewColumn. but don't know how to apply this knowledge to a Touchelector e.g. the example found here: http://pymaemo.garage.maemo.org/documentation/python_hildon_tutorial/html/ch-Selectors.html#example-of-a-selector-with-a-custom-column ...doesn't work. Maybe the python bindings are not fully working? Did you try with C instead? Claudio ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Python + hildon.TouchSelector (with pixbufs)
Hi Claudio, Thanks for the response. The reason I'm creating the dialog by hand is because I want complete control over it's look and feel. In addition, hildon.PickerButton.set-image() is not working here so i thought it's probably best to use plain old GTK. Concerning the rest of the problems, I'm going to chalk it up to a bug in the bindings because I seem to be doing everything properly. All of the (working) examples I could found online are using Windows to hold the Selector and not Dialogs, so maybe this is the source of the issue. I'm going to work more today creating a Selector with pixbufs and hope that the scrolling problem will get resolved at some point (I'll file a bug). Of course, a resonse from one of the Python Devs is always welcome ;) P.S. I'm not doing this in C because i don't know how to program in C, only Python. On Sun, Aug 30, 2009 at 12:49 PM, Claudio Saavedra csaave...@igalia.comwrote: El dom, 30-08-2009 a las 12:20 -0400, Brent Chiodo escribió: I'm trying to create a simple dialog that opens when you tap a button. In this dialog, I want to place in it a hildon.TouchSelector that has a single column comprised of pixbufs (logos of websites). For this use case, I'd recommend you using directly a HildonPickerButton instead of creating a button, a dialog, and all the logic by hand. Check the docs for HildonPickerbutton. Just to see if I could get a TouchSelector working, I created a simple one that just uses text labels instead of pixbufs. Here is the pertinent part of the code: # This part is the button that opens the dialog self.select_button = gtk.Button() self.select_icon = gtk.gdk.pixbuf_new_from_file_at_size(/usr/share/touchsearch/select_search_engine.png, 40, 40) self.select_image = gtk.Image() self.select_image.set_from_pixbuf(self.select_icon) self.select_image.set_padding(settings['padding'], settings['padding']) self.select_button.set_image(self.select_image) self.select_button.connect(clicked, self.select_engine_dialog) self.select_button.show_all() ... # And this is the dialog with the Touchselector in it def select_engine_dialog(self, widget): dialog = gtk.Dialog(Select A Site To Search, None, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR) close_button = dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) selector = hildon.hildon_touch_selector_new_text() searches = [Google, eBay, Amazon, Merriam-Webster, Google Maps, Google Images, maemo.org] for i in searches: selector.append_text(i) dialog.vbox.add(selector) dialog.show_all() response = dialog.run() dialog.destroy() When I run this example I get exactly what I expected except the TouchSelector doesn't scroll -- when I drag it in either direction it shows me the indicator of where the focus is, but it doesn't move. Errors from traceback are: /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonPannableAreaMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_enum: assertion `G_TYPE_IS_ENUM (enum_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonMovementMode' selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed selector = hildon.hildon_touch_selector_new_text() /usr/lib/hildon-desktop/touchsearch.py:68: Warning: cannot register existing type `HildonSizeRequestPolicy' I am not familiar with the python bindings, so I have not much to say about these errors other than it seems that the registration of some of the types fail, which is strange.. In addition to that, once I get that working how would I go about getting pixbufs in there instead of just text? I'm familiar with how to create a gtk.TreeView, HildonTouchSelector uses HildonTouchSelectorColumn for each of its columns. Since you want one single column, you need to create one and use the GtkCellLayout interface in the same way you would do for GtkTreeViewColumn. but don't know how to apply this knowledge to a Touchelector e.g. the example found here: http://pymaemo.garage.maemo.org/documentation/python_hildon_tutorial/html/ch-Selectors.html#example-of-a-selector-with-a-custom-column ...doesn't work. Maybe the python bindings are not fully working? Did you try with C instead? Claudio ___