[Gambas-user] Setting TableView to Row

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Nov 26 17:50:01 CET 2008


Stefano Palmeri schrieb:
> Il mercoledì 26 novembre 2008 10:11:04 Rolf-Werner Eilert ha scritto:
>> Stefano Palmeri schrieb:
>>> Il martedì 25 novembre 2008 11:06:27 Rolf-Werner Eilert ha scritto:
>>>> Hi,
>>>>
>>>> is it possible to set TableView.Row from Code during runtime?
>>>>
>>>> Would be nice to make sure a certain row in the table is selected before
>>>> the user begins working with it (e. g. to draw attention to this row).
>>>>
>>>> Just tried this
>>>>
>>>>    IF po > -1 THEN mesListe.Row = po
>>>>
>>>> but nothing happened. It should trigger the click event of the TableView
>>>> (mesListe) to show something, but I guess this isn't possible here, is
>>>> it?
>>>>
>>>> Thanks for your ideas.
>>>>
>>>> Rolf
>>> I'm not sure that I perfectly understood, but it should be:
>>>
>>> TableView1.MoveTo(1, 0)
>> Ok, I didn't perfectly express my thoughts :-) The question was how to
>> get the event as if the user had clicked the row. If I do it by code the
>> way you describe it, the click event isn't raised, so I will have to
>> take care the other SUB is called then.
>>
>>> I use gb.qt.
>> So do I...
>>
>> And do you know a way to scroll the tableview down to a new entry to
>> make it visible WITHOUT selecting the row? I tried
>>
>> TableView.Row = 17			'no problem, works like MoveTo
>> TableView.Current.EnsureVisible		'that runs good
>> TableView.Row = -1			'that destroys the selection
>>
>> I just want to show the user "here is something new, please click me!"
>> without setting the selection to the line.
>>
>>
>> Regards,
>>
>> Rolf
>>
> 
> Ok, I'm definitevely stupid because I don't understand. 

No you aren't :-) I am...

Thanks for your little example. It performs well, just as expected... in 
Gambas 2. My project still is in Gambas 1, an older one which I didn't 
have the time yet to convert to Gambas 2.

So that seems to be the reason, the TableView simply seems to react 
different in those versions, more clever in Gambas 2. I cannot persuade 
it to react like this in Gambas 1. If you add TableView.Row = -1, it 
jumps back to the beginning of the list.


Ok, I'll keep it like

TableView.MoveTo(position, 0)
TableView.EnsureVisible

which sets the blue selection on that line and makes it a bit visible 
(really only a bit in my app, but one can see something...)

And the next step will be to make a little window appear for a few 
seconds or some other hint somewhere around there saying "You got 
something new to look for".


Anyway, thanks a lot for your help!

Rolf




More information about the User mailing list