logo       

SimpleList questions from a beginner: msg#00259

Subject: SimpleList questions from a beginner
Warning! I'm completely new to gtk-perl, with no prior experience writing gnome apps in other languages. I've been using Perl-Tk for some years, though, but the amount of documentation to read for Gnome development is overwhelming. And no, I haven't read it all yet...

Background: I've started writing an application which will have data stored in a MySQL database. The plan is to use the TreeView widget for editing/navigation/selection tasks within this data store. To prepare this part of the project, I've started playing around with the "simplelist.pl" example (from 1.00rc3), just to get familiar with the widget.

Question one: I noticed that I couldn't "push" an array to the SimpleList. Instead, I had to push row by row. Is this a bug, or is it meant to work this way? Looking at the implementation, I would guess the same applies to "unshift"...

I would like to allow the users to move columns around by drag and drop. I was able to change the example program to do this. It wasn't even difficult... However

Question two: What does the column indexing look like after user reordering of columns? It seemed inconsistant to me... When adding data to the list, the original indexing was used. This is what I would expect, since the model shouldn't change by a column reorder. However, the "editable" checkbutton in the program seemed to change the "editable" attribute of the first column in the actual visible table, not the first column in the model. Is this the way it is supposed to be? Is there a way to get around it without listening in to the drag/drop signals and keeping track of what the user has been doing lately?

I would also like the user to be able to edit a cell by selection from a (small) number of alternatives. Something like an OptionMenu in a cell of the table. From my (admittedly incomplete) reading of the docs, the way I'm supposed to do this is by making a customized cell renderer for the graphical presentation, and a customized data type for the actual data to display. How to implement the customized data type is shown in the example.

Question three: Am I on the right track? Does anybody have any example code for customized renderers I could look at? Would I have to write the renderer in C, or is the class inheritance between GObjects and perl classes transparant enough for me to write my own class that inherits from Gtk::CellRenderer and take it from there?

Bjarne


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe