Re: Running a simple GUI app

2008-08-22 Thread John Emmas

Thanks Phil,

As it turns out, a lot of my problems have been solved by doing something
called a rebase (I needed to start 'ash' and then type 'rebaseall').

There's very little information about this on the internet.  Can anyone 
explain what exactly I've done and why it's improved things so much?


Regards,

John



- Original Message - 
From: Phil Betts [EMAIL PROTECTED]

To: cygwin-xfree@cygwin.com
Sent: 19 August 2008 09:42
Subject: RE: Running a simple GUI app


John Emmas wrote on Monday, August 18, 2008 7:43 PM::


Sorry Phil if my questions seem 'lame'.  I should have explained that
I only installed Cygwin this morning so I'm by no means up to speed
with the concepts or terminology.


I'm sorry if it came across wrongly.  I didn't mean to suggest you were
currently lame.  I had assumed from the context that you were probably
new to at least some of the technology and was trying to steer you away
from _becoming_ a lame Windows user.


Anyway, I managed to arrange Windows so that it now starts X at boot
up. This means that I can use a (DOS) console window to navigate to
the appropriate directory, type 'HelloWorld' and my HelloWorld app
launches with X just running silently in the background.  That's a
lot slicker than the procedure I was using a few hours ago.  Thanks
for the suggestion.

What's strange though is that I can't just double-click on the app's
icon and launch it.  There's a (slim) chance that this could be a
Windows problem but I've never known any other Windows app that can
be started from a command line but can't be started by clicking its
icon.  Any ideas?


As cgf has suggested, it's probably the DISPLAY environment variable.
Alternatively, you could use the standard X parameter -display :0
if your program supports it.

Phil
--
This email has been scanned by Ascribe PLC using Microsoft Antigen for
Exchange.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Running a simple GUI app

2008-08-22 Thread Larry Hall (Cygwin X)

John Emmas wrote:

Thanks Phil,

As it turns out, a lot of my problems have been solved by doing something
called a rebase (I needed to start 'ash' and then type 'rebaseall').

There's very little information about this on the internet.  Can anyone 
explain what exactly I've done and why it's improved things so much?


Did you read '/usr/share/doc/Cygwin/rebase-2.4.3.README'?

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 429-6305 - FAX
Holliston, MA 01746

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



RE: Running a simple GUI app

2008-08-19 Thread Phil Betts
John Emmas wrote on Monday, August 18, 2008 7:43 PM::

 Sorry Phil if my questions seem 'lame'.  I should have explained that
 I only installed Cygwin this morning so I'm by no means up to speed
 with the concepts or terminology.

I'm sorry if it came across wrongly.  I didn't mean to suggest you were
currently lame.  I had assumed from the context that you were probably 
new to at least some of the technology and was trying to steer you away 
from _becoming_ a lame Windows user.

 Anyway, I managed to arrange Windows so that it now starts X at boot
 up. This means that I can use a (DOS) console window to navigate to
 the appropriate directory, type 'HelloWorld' and my HelloWorld app
 launches with X just running silently in the background.  That's a
 lot slicker than the procedure I was using a few hours ago.  Thanks
 for the suggestion. 
 
 What's strange though is that I can't just double-click on the app's
 icon and launch it.  There's a (slim) chance that this could be a
 Windows problem but I've never known any other Windows app that can
 be started from a command line but can't be started by clicking its
 icon.  Any ideas? 

As cgf has suggested, it's probably the DISPLAY environment variable.
Alternatively, you could use the standard X parameter -display :0 
if your program supports it.

Phil
-- 
This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



RE: Running a simple GUI app

2008-08-18 Thread Phil Betts
John Emmas wrote on Monday, August 18, 2008 4:55 PM::

 Hi there,
 
 After installing Cygwin (under WinXP) I've got to the stage of
 compiling a very simple Hello World app which just displays an
 empty GTK dialog with the title Hello World.  To run the app I
 (currently) have to start Cygwin (using its desktop icon), type
 startx into the DOS terminal (which opens a second terminal
 window), navigate to the folder containing my executable and finally
 type ./HelloWorld.  Obviously this is all a bit convoluted.  Is
 there a simpler way to launch my app - for example:- 
 
 a)  Double clicking on an icon, or
 b)  Issuing some command (from a DOS terminal) that would launch the
 app - but starting Cygwin and X invisibly.
 
 Thanks,
 
 John

First, there's no such concept as starting Cygwin.  Cygwin is just
a DLL.  If you mean start a bash session, there's no need to do
that just to run an X program.


You could* write a bash script along the lines of:

 /path/to/runyourprog ---
#!/bin/bash --login

checkx || startx
exec yourprogname
-

The --login should ensure that the environment is set up correctly.

Then you can create a shortcut with a target of:

C:\cygwin\bin\bash -c /path/to/runyourprog


* This is very much a lame Windows-user type of thing to be doing.
Xwin is a SERVER.  It should not be started by running a client.  
If you were to ask a linux mailing list for a way to switch runlevel
if someone tried to run your program without an X server, you would 
rightly expect the electronic equivalent of howls of derision.

Why do you not just start X when you log on?  If you'd rather not 
start X every time you log on, you only need to start it the first 
time you try to run an X program.  Any properly written X program 
(including yours) should tell the user if it cannot connect to the 
X server, so if you get this message, you just need to run the 
server - once, then try again.

Phil

-- 
This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Running a simple GUI app

2008-08-18 Thread John Emmas

Sorry Phil if my questions seem 'lame'.  I should have explained that I only
installed Cygwin this morning so I'm by no means up to speed with the
concepts or terminology.

Anyway, I managed to arrange Windows so that it now starts X at boot up.
This means that I can use a (DOS) console window to navigate to the
appropriate directory, type 'HelloWorld' and my HelloWorld app launches
with X just running silently in the background.  That's a lot slicker than
the procedure I was using a few hours ago.  Thanks for the suggestion.

What's strange though is that I can't just double-click on the app's icon
and launch it.  There's a (slim) chance that this could be a Windows problem
but I've never known any other Windows app that can be started from a
command line but can't be started by clicking its icon.  Any ideas?

John



- Original Message - 
From: Phil Betts [EMAIL PROTECTED]

To: cygwin-xfree@cygwin.com
Sent: 18 August 2008 16:41
Subject: RE: Running a simple GUI app


John Emmas wrote on Monday, August 18, 2008 4:55 PM::


Hi there,

After installing Cygwin (under WinXP) I've got to the stage of
compiling a very simple Hello World app which just displays an
empty GTK dialog with the title Hello World.  To run the app I
(currently) have to start Cygwin (using its desktop icon), type
startx into the DOS terminal (which opens a second terminal
window), navigate to the folder containing my executable and finally
type ./HelloWorld.  Obviously this is all a bit convoluted.  Is
there a simpler way to launch my app - for example:-

a)  Double clicking on an icon, or
b)  Issuing some command (from a DOS terminal) that would launch the
app - but starting Cygwin and X invisibly.

Thanks,

John


First, there's no such concept as starting Cygwin.  Cygwin is just
a DLL.  If you mean start a bash session, there's no need to do
that just to run an X program.


You could* write a bash script along the lines of:

 /path/to/runyourprog ---
#!/bin/bash --login

checkx || startx
exec yourprogname
-

The --login should ensure that the environment is set up correctly.

Then you can create a shortcut with a target of:

C:\cygwin\bin\bash -c /path/to/runyourprog


* This is very much a lame Windows-user type of thing to be doing.
Xwin is a SERVER.  It should not be started by running a client.
If you were to ask a linux mailing list for a way to switch runlevel
if someone tried to run your program without an X server, you would
rightly expect the electronic equivalent of howls of derision.

Why do you not just start X when you log on?  If you'd rather not
start X every time you log on, you only need to start it the first
time you try to run an X program.  Any properly written X program
(including yours) should tell the user if it cannot connect to the
X server, so if you get this message, you just need to run the
server - once, then try again.

Phil

--
This email has been scanned by Ascribe PLC using Microsoft Antigen for
Exchange.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Running a simple GUI app

2008-08-18 Thread Christopher Faylor
On Mon, Aug 18, 2008 at 06:42:58PM -, John Emmas wrote:
 Sorry Phil if my questions seem 'lame'.  I should have explained that I 
 only
 installed Cygwin this morning so I'm by no means up to speed with the
 concepts or terminology.

 Anyway, I managed to arrange Windows so that it now starts X at boot up.
 This means that I can use a (DOS) console window to navigate to the
 appropriate directory, type 'HelloWorld' and my HelloWorld app launches
 with X just running silently in the background.  That's a lot slicker than
 the procedure I was using a few hours ago.  Thanks for the suggestion.

 What's strange though is that I can't just double-click on the app's icon
 and launch it.  There's a (slim) chance that this could be a Windows 
 problem
 but I've never known any other Windows app that can be started from a
 command line but can't be started by clicking its icon.  Any ideas?

X apps use a DISPLAY environment variable to denote which display they
should attach to.  It's possible that all that you need to do is add
DISPLAY=:0 to your environment via the Control Panel-Systems setting.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/