accessing a cell in a table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

accessing a cell in a table

Florent Arrignon
Hi all,

I'm a beginner in programming and Smalltalk so all my apologies if the question is trivial. :-)

I would like to display a very simple and efficient map based on a Table. The idea would be to change the cell color (background and foreground) according to information contained in the TwoDList. The TwoDList being for example the cells composing a global map.

I created a small interface with only one table in the main window, following the tutorial initialize method. The table is registered as tableTest in the application model. The first step was to try to modify the background color of one cell by pushing an action button named "drawLegend" that launch a method, after the table was initialized.

I tried to use the method in the TableInterface class named backgroundColorAtIndex: index put: aColor in the following way:

self tableTest backgroundColorAtIndex: 1@1 put: #red

When pushing the action button , I receive the following message from the debugger:

unhandled exception: message not understood: #canPaintMedium. This happens in the ScreenGraphicsContext, with paint: paintValue

"paintValue canPainMedium: medium" can not work as medium is anApplicationWindow.

So I believe I was not successful to access to a cell of the table and instead of I accessed to the main window.  I searched in the tutorials but was not able to find it ! Sorry if I missed something evident.

Thanks for your help !

Cheers,

Florent Arrignon






Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez d'un filtre antispam gratuit ! Windows Live Hotmail
Reply | Threaded
Open this post in threaded view
|

re: accessing a cell in a table

Maarten Mostert-2

Welcome to Wrapper,

@+Maarten,

> Message du 11/09/07 10:48

> De : "Florent Arrignon"
> A : [hidden email]
> Copie à :
> Objet : accessing a cell in a table
>
> Hi all,
>
> I'm a beginner in programming and Smalltalk so all my apologies if the question is trivial. :-)
>
> I would like to display a very simple and efficient map based on a Table. The idea would be to change the cell color (background and foreground) according to information contained in the TwoDList. The TwoDList being for example the cells composing a global map.
>
> I created a small interface with only one table in the main window, following the tutorial initialize method. The table is registered as tableTest in the application model. The first step was to try to modify the background color of one cell by pushing an action button named "drawLegend" that launch a method, after the table was initialized.
>
> I tried to use the method in the TableInterface class named backgroundColorAtIndex: index put: aColor in the following way:
>
> self tableTest backgroundColorAtIndex: 1@1 put: #red
>
> When pushing the action button , I receive the following message from the debugger:
>
> unhandled exception: message not understood: #canPaintMedium. This happens in the ScreenGraphicsContext, with paint: paintValue
>
> "paintValue canPainMedium: medium" can not work as medium is anApplicationWindow.
>
> So I believe I was not successful to access to a cell of the table and instead of I accessed to the main window.  I searched in the tutorials but was not able to find it ! Sorry if I missed something evident.
>
> Thanks for your help !
>
> Cheers,
>
> Florent Arrignon
>
>
>
>
>

Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez d'un filtre antispam gratuit ! Windows Live Hotmail
Reply | Threaded
Open this post in threaded view
|

RE: accessing a cell in a table

Mark Plas
In reply to this post by Florent Arrignon

Hi Florent,

 

You should write:

 

self tableTest backgroundColorAtIndex: 1@1 put: ColorValue red

 

The method expects a ColorValue as an argument. Not a Symbol.

 


From: Florent Arrignon [mailto:[hidden email]]
Sent: dinsdag 11 september 2007 10:47
To: [hidden email]
Subject: accessing a cell in a table

 

Hi all,

I'm a beginner in programming and Smalltalk so all my apologies if the question is trivial. :-)

I would like to display a very simple and efficient map based on a Table. The idea would be to change the cell color (background and foreground) according to information contained in the TwoDList. The TwoDList being for example the cells composing a global map.

I created a small interface with only one table in the main window, following the tutorial initialize method. The table is registered as tableTest in the application model. The first step was to try to modify the background color of one cell by pushing an action button named "drawLegend" that launch a method, after the table was initialized.

I tried to use the method in the TableInterface class named backgroundColorAtIndex: index put: aColor in the following way:

self tableTest backgroundColorAtIndex: 1@1 put: #red

When pushing the action button , I receive the following message from the debugger:

unhandled exception: message not understood: #canPaintMedium. This happens in the ScreenGraphicsContext, with paint: paintValue

"paintValue canPainMedium: medium" can not work as medium is anApplicationWindow.

So I believe I was not successful to access to a cell of the table and instead of I accessed to the main window.  I searched in the tutorials but was not able to find it ! Sorry if I missed something evident.

Thanks for your help !

Cheers,

Florent Arrignon





Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez d'un filtre antispam gratuit ! Windows Live Hotmail