From markus@forfree.at
Received: (qmail 15724 invoked from network); 14 May 1998 13:17:52 -0000
Received: from tom.forfree.at (root@194.106.224.37)
  by mail2.redhat.com with SMTP; 14 May 1998 13:17:52 -0000
Received: from mars.intra.net (anxvr105.cso.net [194.106.224.75])
	by tom.forfree.at (8.8.5/8.8.8) with SMTP id PAA29566
	for <gtk-list@redhat.com>; Thu, 14 May 1998 15:17:48 +0200
Message-Id: <199805141317.PAA29566@tom.forfree.at>
From: "Markus Sabadello" <markus@forfree.at>
Organization: forfree.at
To: gtk-list@redhat.com
Date: Thu, 14 May 1998 15:16:57 +0000
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Subject: Motif
Reply-to: markus@forfree.at
Priority: normal

Hi!

I was wondering how difficult it would be to port a Motif-based 
application to gtk. Has anyone experiences with this?

Markus
________________________________________________________________________
      __                                              
     / /\        name:   Markus Sabadello          [  administrator @  ]
    / /  \       e-mail: markus@sabadello.at       [ http://forfree.at ]
   / / /\ \      sms:    markus.sms@sabadello.at   [  (free services)  ]
  / / /\ \ \
 / /_/__\ \ \                     __  __   _   __  _   __  __    __  ___
/________\ \ \   FREE homepage   |__ |  | |_) |__ |_) |__ |__   |__|  |
\___________\/   FREE e-mail     |   |__| | \ |   | \ |__ |__ . |  |  |

From alainj@paris.bok.net
Received: (qmail 18519 invoked from network); 14 May 1998 17:11:19 -0000
Received: from dnai-207-181-252-98.dsl.dnai.com (HELO paris.bok.net) (207.181.252.98)
  by mail2.redhat.com with SMTP; 14 May 1998 17:11:19 -0000
Received: from cybersoft.org (otv-230.opentv.com [208.209.47.230])
	by paris.bok.net (8.8.7/8.8.7) with ESMTP id KAA19896
	for <gtk-list@redhat.com>; Thu, 14 May 1998 10:09:28 -0700
Sender: alainj@paris.bok.net
Message-ID: <355B26B0.8C598E8@cybersoft.org>
Date: Thu, 14 May 1998 10:15:28 -0700
From: Alain Jobart <aj@cybersoft.org>
X-Mailer: Mozilla 4.05 [en] (X11; U; SunOS 5.5.1 sun4u)
MIME-Version: 1.0
To: gtk-list@redhat.com
Subject: Re: Motif
References: <199805141317.PAA29566@tom.forfree.at>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I ported MXaudio (http://www.xaudio.com/mxaudio) to GTK in a week or so,
including special widget coding. The result is gxaudio
(http://www.cybersoft.org/gxaudio), and I like it better than the old
Motif version. (I must say I did it in my free time, no for any work
related reason).

Basically, if you take your C Motif code, since GTK has about the same
concepts, you still have all your callbacks working about the same way,
so no surprise at all. Any other fancy stuff (timers, listening on a
pipe, ...) works the same.

I would say also than all the dialog problems you experience with Motif
(you never know when to Popup, Realize, ...) is gone with GTK: you just
show...
And then, compiling GTK on any platform is easy, so even on my Solaris
box, I prefer to use GTK than Motif, even if Motif is bundled with the
OS...

So go for it, do your port !!! :)

Alain.

Markus Sabadello wrote:
> 
> Hi!
> 
> I was wondering how difficult it would be to port a Motif-based
> application to gtk. Has anyone experiences with this?
>
> Markus
> ________________________________________________________________________
>       __
>      / /\        name:   Markus Sabadello          [  administrator @  ]
>     / /  \       e-mail: markus@sabadello.at       [ http://forfree.at ]
>    / / /\ \      sms:    markus.sms@sabadello.at   [  (free services)  ]
>   / / /\ \ \
>  / /_/__\ \ \                     __  __   _   __  _   __  __    __  ___
> /________\ \ \   FREE homepage   |__ |  | |_) |__ |_) |__ |__   |__|  |
> \___________\/   FREE e-mail     |   |__| | \ |   | \ |__ |__ . |  |  |
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

--
E-mail: aj@cybersoft.org         /-----/       
http://www.cybersoft.org/~aj
P-mail: 3401-A Hillview Avenue - Palo Alto CA 94304-1348 X-Mail:
1-415-849-5542

From mjhammel@fastlane.net
Received: (qmail 13302 invoked from network); 14 May 1998 19:20:20 -0000
Received: from fastlane.net (209.197.224.10)
  by mail2.redhat.com with SMTP; 14 May 1998 19:20:20 -0000
Received: from feynman.fastlane.net (root@feynman.fastlane.net [204.251.16.205])
	by fastlane.net (8.8.8/8.8.8) with ESMTP id OAA08418;
	Thu, 14 May 1998 14:20:20 -0500 (CDT)
Received: (from mjhammel@localhost) by feynman.fastlane.net (8.8.5/8.7.3) 
id NAA05834; Thu, 14 May 1998 13:29:34 -0600
From: "Michael J. Hammel" <mjhammel@fastlane.net>
Message-Id: <199805141929.NAA05834@feynman.fastlane.net>
Subject: Re: [gtk-list] Motif
To: markus@forfree.at
Date: Thu, 14 May 1998 13:29:34 -0600 (MDT)
Cc: gtk-list@redhat.com
In-Reply-To: <199805141317.PAA29566@tom.forfree.at> 
from "Markus Sabadello" at May 14, 98 03:16:57 pm
Content-Type: text

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).  There also seem to be 5
element arrays for bg, fg, and other colors.  I thought this might be the 3
RGB colors plus 1 alpha channel, but I don't know what the 5 element is for.

Most of the differences are mostly just a matter of learning the new API.
In general its easier (re: less code) to create a window component (label, 
text field, etc) in Gtk, but its harder to do all the things that are
handled in convenience routines in Motif.  The latter is probably just a
matter of time for Gtk - its still a young widget set.  The use of common
resources, like background colors, are not consistant across all widgets
yet.  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.

And, of course, theres not printed manuals for Gtk.  (Yet.) :-)

I'm still fairly new to Gtk myself and this is just based on my experiences
so far.  I have a moderately long list of things I've noted about dealing with 
Gtk that Motif programmers might find useful.  If you're interested I'll
pass it along.  Eventually, I'll either post it on my web site or just
point folks to my XNotesPlus package (which will include it too).
-- 
Michael J. Hammel           |The Space People think factories are musical
The Graphics Muse           |instruments.  They sing along with them.  Each song
mjhammel@graphics-muse.org  |lasts from 8am to 5pm.  No music on weekends.
http://www.graphics-muse.org        Talking Heads - "Stop Making Sense"

From clahey@umich.edu
Received: (qmail 30062 invoked from network); 14 May 1998 21:52:51 -0000
Received: from berzerk.rs.itd.umich.edu (smtp@141.211.63.17)
  by mail2.redhat.com with SMTP; 14 May 1998 21:52:51 -0000
Received: from galaga.rs.itd.umich.edu (smtp@galaga.rs.itd.umich.edu [141.211.63.95])
        by berzerk.rs.itd.umich.edu (8.8.8/4.3-mailhub) with ESMTP id RAA07436
        for <gtk-list@redhat.com>; Thu, 14 May 1998 17:52:50 -0400 (EDT)
Received: from localhost (clahey@localhost)
	by galaga.rs.itd.umich.edu (8.8.8/5.1-client) with SMTP id RAA04574
	for <gtk-list@redhat.com>; Thu, 14 May 1998 17:52:49 -0400 (EDT)
Precedence: first-class
Date: Thu, 14 May 1998 17:52:49 -0400 (EDT)
From: Christopher James Lahey <clahey@umich.edu>
X-Sender: clahey@galaga.rs.itd.umich.edu
Reply-To: Christopher James Lahey <clahey@umich.edu>
To: gtk-list@redhat.com
Subject: Re: [gtk-list] Re: Motif
In-Reply-To: <199805141929.NAA05834@feynman.fastlane.net>
Message-ID: <Pine.SOL.3.95.980514174348.2428A-100000@galaga.rs.itd.umich.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Thu, 14 May 1998, Michael J. Hammel wrote:

> probably do it programmatically using GC's).  There also seem to be 5
> element arrays for bg, fg, and other colors.  I thought this might be the 3
> RGB colors plus 1 alpha channel, but I don't know what the 5 element is for.

I think that these 5 element arrays are for the 5 different states,
NORMAL, ACTIVE, PRELIGHT, SELECTED, and INSENSITIVE (see the first entry
in gtkenums.h.)  Each of the states has a set of GCs to describe what the
widget is supposed to look like in that state. 

This is how the buttons turn bright when you enter them with the mouse and
dark when they're depressed.  This is also how testgtk changes the colors
for the PRELIGHT state.
  Chris

From owt1@cornell.edu
Received: (qmail 10895 invoked from network); 15 May 1998 01:20:36 -0000
Received: from cu-dialup-0808.cit.cornell.edu (mail@132.236.155.54)
  by mail2.redhat.com with SMTP; 15 May 1998 01:20:36 -0000
Received: from otaylor by cu-dialup-0808.cit.cornell.edu with local (Exim 1.82 #1)
	id 0ya8ZV-00031Y-00; Thu, 14 May 1998 20:42:01 -0400
To: "Michael J. Hammel" <mjhammel@fastlane.net>
Cc: markus@forfree.at,  gtk-list@redhat.com
Subject: Re: Motif
References: <199805141929.NAA05834@feynman.fastlane.net>
From: Owen Taylor <otaylor@gtk.org>
Date: 14 May 1998 20:42:01 -0400
In-Reply-To: "Michael J. Hammel"'s message of Thu, 14 May 1998 13:29:34 -0600 (MDT)
Message-ID: <lz90o41i1y.fsf@cu-dialup-0808.cit.cornell.edu>
Lines: 54
X-Mailer: Gnus v5.5/Emacs 20.2
X-Emacs: Emacs 20.2, MULE 3.0 (MOMIJINOGA)
MIME-Version: 1.0 (generated by SEMI MIME-Edit 0.98 - =?ISO-8859-4?Q?"D=F2?=
  =?ISO-8859-4?Q?h=F2ji"?=)
Content-Type: text/plain; charset=US-ASCII
Sender: Owen Taylor <owt1@cornell.edu>



"Michael J. Hammel" <mjhammel@fastlane.net> 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);

Regards,
                                        Owen