Background image in dialog?
Hello,
I know a dialog background color can easily be changed but, just to be sure, there is no way to add a background image to a dialog?
Thank you.
Hello,
I know a dialog background color can easily be changed but, just to be sure, there is no way to add a background image to a dialog?
Thank you.
Go frenzy…
Image.prototype.onDraw = function()
{ // written by Marc Autret
// "this" is the container; "this.image" is the graphic
if( !this.image ) return;
var WH = this.size,
wh = this.image.size,
k = Math.min(WH[0]/wh[0], WH[1]/wh[1]),
xy;
// Resize proportionally:
wh = [k*wh[0],k*wh[1]];
// Center:
xy = [ (WH[0]-wh[0])/2, (WH[1]-wh[1])/2 ];
this.graphics.drawImage(this.image,xy[0],xy[1],wh[0],wh[1]);
WH = wh = xy = null;
}
var w =new Window( 'dialog' );
var g = w.add('group');
var u;
var i = g.add ('image', u, File(Folder.desktop+"/campagne.jpeg" ) );
w.margins = 0;
g.orientation = "stack";
w.alignChildren = g.alignChildren = ["fill","fill"];
var mainGp = g.add('group');
mainGp.margins = 5;
mainGp.alignChildren = ["left", "top" ];
mainGp.add('edittext', u, 'What a nice background…');
mainGp.add('checkbox', u, 'Do you like it ?');
w.onDraw = function() {
i.size = w.size;
}
w.show();

Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.