[Mono-devel-list] Problem on launching a mono application

2005-03-10 Thread Benoit Caccinolo
Hi all,

I have developped a little applet in Mono. It works fine launching it
from a terminal but I can't launch it from the Application launcher. Is
there a environment problem?

-- 
Benoit Caccinolo [EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part


[Mono-list] About the thumbnail creator

2004-06-16 Thread Benoit Caccinolo
Hi all,

Did anyone try the code to generate web page thumbnails given by Miguel
de Icaza on his blog
(http://primates.ximian.com/~miguel/archive/2004/Jun-14.html)

The resulting shot has the good size but it is empty. I'm using Mono
Beta2 from the sources on a Debian. 

An idea ? 

-- 
Benoit C.

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] About the thumbnail creator

2004-06-16 Thread Benoit Caccinolo
When I launch it a window appears but nothing is displayed in it. Few
seconds after the program quits and my shot.png has the good size but is
empty. 

The problem is the same with any other web page, even local one.

On Wed, 2004-06-16 at 16:57, Denis Gervalle wrote:
 Benoit Caccinolo wrote:
  On Wed, 2004-06-16 at 14:34, Denis Gervalle wrote:
  
 Replace wc.LoadUrl(args[0]); by wc.LoadUrl(url); and maybe, it will 
 works better when the url is not provided as the first argument. 
 Checking that url is not null before proceding may also be useful when 
 you forget to provide an Url.
  
  
  It is modified but the problem is the same :(
  
 
 Benoit,
 
 What Url are you trying ?
 For example, I have notice that it works well for http://www.go-mono.com
 but not for http://www.softec.st.
 This is probably due to some redirection in the way.
 Here is my command line that works:
 mono progname.exe -width 240 -height 160 http://www.go-mono.com
 
 Denis Gervalle
 SOFTEC sa
 http://www.softec.st


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] About the thumbnail creator

2004-06-16 Thread Benoit Caccinolo
On Wed, 2004-06-16 at 18:20, Todd Berman wrote:
 I think the issue is mozilla not getting enough time to render. I would 
 try putting a Thread.Sleep (3000) or something as the first line of code 
 in the NetStop handler.

The problem is surely a problem of time. But with a Thread.Sleep in the
MakeShot method the problem is not solved cause the sleep stops the
rendering too :)

My solution is too put a button to launch the MakeShot method. It is
less elegant but it works.

Thx

Here is the code.

using System;
using Gtk;
using Gecko;

class Thumbnail { 
static WebControl wc;
static string output = shot.png;
static string url;
static int width = -1;
static int height = -1;

static void Main (string [] args)
{
for (int i = 0; i  args.Length; i++){
switch (args [i]){
case -width:
try {
i++;
width = Int32.Parse (args [i]);
} catch {
Console.WriteLine (-width requires an numeric 
argument);
}
break;
case -height:
try {
i++;
height = Int32.Parse (args [i]);
} catch {
Console.WriteLine (-height requires an 
numeric argument);
}
break;
case -help:
case -h:
Help ();
break;

default:
if (url == null)
url = args [i];
else if (output == null)
output = args [i];
else
Help ();
break;
}
}

Application.Init();
Window w = new Window (test);
VBox vbox = new VBox ();
Button bt = new Button (Take a Shot);
bt.Clicked += new EventHandler (btn_click);
vbox.PackStart (bt);

wc = new WebControl ();
wc.LoadUrl (url);
//wc.NetStop += MakeShot;
//wc.Show ();
wc.SetSizeRequest (800, 600);
vbox.PackStart (wc);
w.Add (vbox);
w.ShowAll ();
Application.Run();

System.Threading.Thread.Sleep (1500);
}

static void Help ()
{
Console.WriteLine (Usage is: shot [-width N] [-height N] url
[shot]);
Environment.Exit (0);
}

 static void btn_click (object obj, EventArgs args)
 {
  Console.WriteLine (Button Clicked);
  MakeShot();
 }
 
static void MakeShot()
{   
System.Console.Write(Taking a new shot);  

Gdk.Window win = wc.GdkWindow;
int iwidth = wc.Allocation.Width;
int iheight = wc.Allocation.Height;
Gdk.Pixbuf p = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, iwidth,
iheight);
Gdk.Pixbuf scaled;

p = p.GetFromDrawable (win, win.Colormap, 0, 0, 0, 0, iwidth,
iheight);
if (width == -1){
if (height == -1)
scaled = p;
else
scaled = p.ScaleSimple (height * iwidth / iheight, 
height,
Gdk.InterpType.Hyper);
} else {
if (height == -1)
scaled = p.ScaleSimple (width, width * iheight / 
iwidth,
Gdk.InterpType.Hyper);
else
scaled = p.ScaleSimple (width, height, 
Gdk.InterpType.Hyper);
}

scaled.Savev (output, png, null, null);  
}

}



___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mono Library Paths on OS X

2004-06-15 Thread Benoit
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
In which path should mono libraries reside on OS X, or is there a 
environment variable for this?
Elfred Pagán
	In beta 1 all was installed in /opt/local and this is what I add to my 
zsh shell in order dor mono to work :

- -
PATH=$PATH:/opt/local/bin
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/local/lib/pkgconfig
MANPATH=$MANPATH:/opt/local/man
export PATH
export MANPATH
export PKG_CONFIG_PATH
- -
	In beta who have the choice between an install in /opt/local and 
another one in the standard framework path of Mac OS X (I haven't test 
this one so I can't say anything more on it).
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFAzpy4YGNyxq4CpJARAgWgAJ0VDLEzOutO9NoVcuaYtzfKw9dBuwCfaA5A
njqseNhwJT5efToUX2XRG0A=
=S9Fx
-END PGP SIGNATURE-
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] About the new site

2004-06-12 Thread Benoit Caccinolo

To have a beautiful icon in my epiphany bookmarks, you should insert the
mono icon like the go-mono site. 

link rel=icon href=MonoIcon.png type=image/png

Thanks.
-- 
Benoit C.

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list