Creating new widgets



Hi all,

I've come to a point where I need to convert an old (but handy) widget I created in perl/Tk into Gtk2. The widget in question is a multiple-entry form (MEF for short) that contains a matrix of entries, each row ending in two buttons - one for adding a new row below and one for deleting this row. The top row also has a third button for adding a row to the top, but that's not that important at this point. The entries can either be normal entries, comboboxes or comboentries, defined on a column by column basis

A single column version of this widget might look like (fixed font!) :

 --------------------------------   -   -
| This is the first entry        | |V| |X|
 ================================   =   =
| This is the second entry       | |V| |X|
 --------------------------------   -   -

and if the 'insert below' button was clicked on the first entry's buttons you'd have:

 --------------------------------   -   -
| This is the first entry        | |V| |X|
 ================================   =   =
| This is the new entry          | |V| |X|
 ================================   =   =
| This is the second entry       | |V| |X|
 --------------------------------   -   -


Making the perl/Tk version of this was pretty easy, but I really have no idea how to do it in Gtk2. I've seen the subclassing widgets writeup, but its both missing important details and doesn't really help here as I can't think of a parent widget all to easily (maybe a table?)

There's also the possibility of doing the same thing inside a ListView with editable cells for the
entires. But from what I've seen there are problems with combobox/entries in listviews, and I haven't seen a cell renderer for buttons.

Can anyone point me in the right direction? I can work around this but I've found this MEF widget quite handy in the past.

Thanks,
MB


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]