Re: uicontrol TABLE

classic Classic list List threaded Threaded
7 messages Options
Iza Iza
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

Hello,

Sorry for returning to the topic of editting uicontrol Table but I still
don't know how it works. When I change the data in a Help example (code
below) the resulting table t2 doesn't change.

// Start of code

params = [" " "Country" "Population [Mh]" "Temp.[°C]" ];
towns = ["Mexico" "Paris" "Tokyo" "Singapour"]';
country = ["Mexico" "France" "Japan" "Singapour"]';
pop  = string([22.41 11.77 33.41 4.24]');
temp = string([26 19 22 17]');
table = [params; [ towns country pop temp ]]

f = gcf();
clf
as = f.axes_size;  // [width height]
ut = uicontrol("style","table",..
                "string",table,..
                "position",[5 as(2)-100 300 87],.. // => @top left corner
of
figure
                "tooltipstring","Data from majors towns")

// Modify by hand some values in the table. Then get them back from the
ui:
t2=matrix(ut.string,size(table))

// End of code

I use a version from this site which should work:
http://www.scilab.org/fr/development/nightly_builds/master

Kind regards,
Iza
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

Hello Izabela,

Le 18/10/2018 à 12:47, Izabela Wójcik-Grząba a écrit :
> Hello,
>
> Sorry for returning to the topic of editting uicontrol Table but I still
> don't know how it works. When I change the data in a Help example (code
> below) the resulting table t2 doesn't change.

You are likely using Scilab 5.5.2. This bug is fixed in Scilab 6.

Regards
Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

In reply to this post by Iza
Le 18/10/2018 à 12:47, Izabela Wójcik-Grząba a écrit :
> .../...
> I use a version from this site which should work:
> http://www.scilab.org/fr/development/nightly_builds/master

I am not able to reproduce the Scilab 5 bug with the NB master for Windows.
For me, changing values works as expected.

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Iza Iza
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

I have 6.01 version and changing values doesn't work. When the figure
with table pops up I change some values, then close the window and check
a t2 variable. The table t2 is unchanged. Maybe I am doing something
wrong?


Iza



W dniu 29.10.2018 14:00, Samuel Gougeon napisał(a):

> Le 18/10/2018 à 12:47, Izabela Wójcik-Grząba a écrit :
>> .../...
>> I use a version from this site which should work:
>> http://www.scilab.org/fr/development/nightly_builds/master
>
> I am not able to reproduce the Scilab 5 bug with the NB master for
> Windows.
> For me, changing values works as expected.
>
> Samuel
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

Le 29/10/2018 à 15:46, Izabela Wójcik-Grząba a écrit :
> I have 6.01 version and changing values doesn't work. When the figure
> with table pops up I change some values, then close the window and
> check a t2 variable.

If you really do things in this order, you kill the uicontrol that can't
be addressed anymore, and you should get an error message:

--> t2=matrix(ut.string,size(table))
at line     7 of function %h_e ( SCI\modules\graphics\macros\%h_e.sci
line 19 )

get: The handle is not or no more valid.

and then yes, t2 has not been updated.

> The table t2 is unchanged. Maybe I am doing something wrong?
>
> Iza

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

Le 29/10/2018 à 16:02, Samuel Gougeon a écrit :
> Le 29/10/2018 à 15:46, Izabela Wójcik-Grząba a écrit :
>> I have 6.01 version and changing values doesn't work. When the figure
>> with table pops up I change some values, then close the window and
>> check a t2 variable.

Aa, you might also have considered that after
t2=matrix(ut.string,size(table))
your t2 always points to the table's content, and that each modification
in the table updates it automatically.
It's the case for ut.string, but not for t2. To update t2, you still
have to rerun
t2=matrix(ut.string,size(table))

Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Iza Iza
Reply | Threaded
Open this post in threaded view
|

Re: uicontrol TABLE

This post was updated on .
In reply to this post by Samuel GOUGEON
Ok, now I can see how it works.
How can I automatically write the new values to the table?
Sorry for asking but I am a little confused with this issue.