Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-12

Newbie question: fpc + gtk + clist

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Eduardo Lopez

Hello all:

1st. Sorry about my english :-)

I'm trying to develop an GUI application with fpc and gtk. And I begin exploring and extending the examples.

I'm working with clist.pp and added three buttons: Insert, Change, Delete. The goal is that the user press anyone and display a convenient form to update de record.

In the example, there is a procedure "selection_made" that respond to the signal "clicked" in the list, and it reads the list and retrieve the data.

The question is: How can I get the same data when the user press the Change button. I can connect a signal to the Change button, but I need to know the row that is selected in the list to read his data.

The secuence is:
1- The user select a row with click ( or just browsing the list ) 2- The use click in the button Change/Delete to update the record.

Thanks in advance.
Eduardo
---

Eduardo Lopez
to Eduardo Lopez

It seems that nobody care ;-) , but this is the solution that I find:

1) Apply to the Clist the attribute GTK_SELECTION_BROWSE
2) Added a global variable that contain the row number selected (filled by the procedure that handle the signal of the Clist)
3) In the "form" , first read the correspnding row selected -using my variable- and fill the entry widgets...

Regards...
Eduardo

Eduardo Lopez wrote 37 lines
Hello all: 1st. Sorry about my english :-) I'm trying to develop an GUI application with fpc and gtk. And I begin exploring and extending the examples. I'm working with clist.pp and added three buttons: Insert, Change, Delete. The goal is that the user press anyone and display a convenient form to update de record. In the example, there is a procedure "selection_made" that respond to the signal "clicked" in the list, and it reads the list and retrieve the data. The question is: How can I get the same data when the user press the Change button. I can connect a signal to the Change button, but I need to know the row that is selected in the list to read his data. The secuence is: 1- The user select a row with click ( or just browsing the list ) 2- The use click in the button Change/Delete to update the record. Thanks in advance. Eduardo --- _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal