[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby gtk editable cells in treeview

Alfonso

11/29/2006 3:37:00 PM

Could anyone put an example of how can you make editable the cells of a
ListStore or ThreeStore in in ruby gtk, and making them update when
edited? I'm trying to guess how to do that looking at the api, but can
get the right procedure, and the tutorial for treeviews doesn't cover
this topic.

Thank you very much for your help.


______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice...

3 Answers

Olivier

11/29/2006 4:26:00 PM

0

Le mercredi 29 novembre 2006 16:37, Alfonso a écrit :
> Could anyone put an example of how can you make editable the cells of a
> ListStore or ThreeStore in in ruby gtk, and making them update when
> edited? I'm trying to guess how to do that looking at the api, but can
> get the right procedure, and the tutorial for treeviews doesn't cover
> this topic.
>
> Thank you very much for your help.

just a quick copy/paste from a personal project :

var_renderer = Gtk::CellRendererText.new
var_renderer.editable = true
var_renderer.signal_connect('edited') do |renderer, val, var|
# use Treeview#selection#selected to modify the
# model. var contains the new text.
end
tog_renderer = Gtk::CellRendererToggle.new
tog_renderer.activatable = true
tog_renderer.signal_connect('toggled') do |renderer, path|
# do whatever you want
end

Any action from the user is handled by signals. The doc does not describe well
what action triggers a signal (even the original C api is poor about that),
so the best thing to do is to seek for the "signal" section of the class api
(here, the CellRendererText), then try to connect to the signal which seems
to fit your needs, and to test :
1) what action triggers the signal
2) what block arguments can be used ( Kernel#p is usefull here ;))

Olivier

Alfonso

11/29/2006 11:37:00 PM

0

Olivier escribió:
> Le mercredi 29 novembre 2006 16:37, Alfonso a écrit :
>
>> Could anyone put an example of how can you make editable the cells of a
>> ListStore or ThreeStore in in ruby gtk, and making them update when
>> edited? I'm trying to guess how to do that looking at the api, but can
>> get the right procedure, and the tutorial for treeviews doesn't cover
>> this topic.
>>
>> Thank you very much for your help.
>>
>
> just a quick copy/paste from a personal project :
>
> var_renderer = Gtk::CellRendererText.new
> var_renderer.editable = true
> var_renderer.signal_connect('edited') do |renderer, val, var|
> # use Treeview#selection#selected to modify the
> # model. var contains the new text.
> end
> tog_renderer = Gtk::CellRendererToggle.new
> tog_renderer.activatable = true
> tog_renderer.signal_connect('toggled') do |renderer, path|
> # do whatever you want
> end
>
> Any action from the user is handled by signals. The doc does not describe well
> what action triggers a signal (even the original C api is poor about that),
> so the best thing to do is to seek for the "signal" section of the class api
> (here, the CellRendererText), then try to connect to the signal which seems
> to fit your needs, and to test :
> 1) what action triggers the signal
> 2) what block arguments can be used ( Kernel#p is usefull here ;))
>
> Olivier
>
>
>
That was what I needed, thank you very much


______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice...

Hans

11/17/2010 7:18:00 PM

0

If that's the case, you're already on the correct path to restoration
by grabbing the test ROM.

Though, just for giggles, I'd also wiggle the CPU board connectors
again to see if one might be contributing to the problem.... For
instance, if you're getting good 5v but not good 12v power via that
connector, it could cause that.

-Hans