Of text_entries, file_selections and libglade



Hi all,
  I am trying to write a GNOME backend to the Elvis vi clone as my first
GNOME/Gtk project and am having a problem which I hope someone can suggest
a solution to.

  I am trying to allow the user to define the dialogue boxes and menus
themselves; and thus they can state that a particular menu option causes a
dialogue box defined in a glade file to be shown and the OK and Apply
buttons to execute 'vi' commands.

  To do this I'm defining a set of substitution rules like this:

?:.,$$s/$searchreplace.searchstring$/$searchreplace.replacestring$/

Such that the search string is the text of the 
'searchreplace.searchstring' entry widget.  My problem is that I want to
be able to use the $name$ syntax to substitute the text result from any
widget with a text result, and in particular from gtk_file_selection's.

At the moment I think I have to look at the widget, figure out what type
it is and then decide whether to call either gtk_entry_get_text or
gtk_file_selection_get_filename or however many other widget types I
support.  Shouldn't all widgets which return a string be descended from a
single type or have a common interface to retrieve the string?

Any suggestions welcome,

Dave

-- 
 --------------------------------------------------------------------   
/ Dr. David Alan Gilbert      | Running Linux on           |  Happy  \ 
\   gro.gilbert @ treblig.org |  Alpha, x86, ARM and SPARC |  In Hex /
 ____________________________|___ http://www.treblig.clara.net   __/



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