Re: Motif

"Michael J. Hammel" <> writes:

> In a previous message, Markus Sabadello says:
> > I was wondering how difficult it would be to port a Motif-based 
> > application to gtk. Has anyone experiences with this?
> Depends on the application.  I've been porting a Motif version of my
> XPostitPlus (now named XNotesPlus) to Gtk recently.  For the most part its
> been pretty straight forward.  The biggest difference is the use of
> resources.  In Motif you have app-defaults files.  In Gtk you have to use
> .rc files, and these aren't quite as easy to use (IMHO, of course).  I also
> had to write a command line parser along the lines of getopt_long() so that
> I could use the same command line args in either version and still
> guarantee portability (since getopt_long() isn't on all Unix platforms by
> default).
> Some differences I can remeber off hand:  there isn't a standard method for
> setting background colors for all widgets.  Some use "bg", others use
> "base".  The label widget, for example, doesn't appear to be able to have
> its background set to a different color from the .rc file (although you can
> probably do it programmatically using GC's). 

- bg[] and base[] are used for different things. I'm note sure how
  to describe the difference other than saying that bg[] is the
  background for things that are by default gray, and base[] is
  the background for things that are normally white. Note that
  some widgets (Like the Text and Entry widgets) have both types
  of backgrounds within them, so they couldn't be controlled by
  the same setting.

- Labels actually don't have an independent background at all -
  they are text without background. To control their background,
  set the background color for their parent. (An EventBox is
  suitable if you don't want anything else).


>  One annoying factor is that the dialogs in GTK have the same resource
> name as the main window.  My XNotesPlus main window is set to have no
> borders by the window manager (fvwm).  With Motif the individual notes have a 
> different resource name (they are PopUp's) so they have borders and title 
> bars.  With GTK all the notes have no title bars (no matter if I make them
> dialogs or popups).  I'm not sure how to get around this one yet.

You can set this with:

void       gtk_window_set_wmclass              (GtkWindow           *window,
						const gchar         *wmclass_name,
						const gchar         *wmclass_class);


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