Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

TK without titlebar / Chromeless TK

by mdog (Pilgrim)
on Feb 07, 2006 at 00:52 UTC ( [id://528383]=perlquestion: print w/replies, xml ) Need Help??

mdog has asked for the wisdom of the Perl Monks concerning the following question:

Brethern --

I am a total novice when it comes to TK. I want to display an image and can do so easily with the code below:

use Tk; use Tk::Photo; use Tk::JPEG; my $mw=new MainWindow; my $foto=$mw->Photo(-file => 'C:\\temp\\itunesart\\702_-_702.jpg'); $mw->Button(-image => $foto)->pack(); $mw->MainLoop;
The rub is that I want to display JUST this image. I don't want the TK titlebar, menu, bars on either side of the image. I don't want to see any of TK. I've been combing the internets and super search and think I'm just not phrasing my search term right. If you were to do this in HTML so you wouldn't see any of the browser, it would called "chromeless" but I don't know the corresponding term for regular application windows. Or is doing this just not possible?

Many thanks,
mdog

Replies are listed 'Best First'.
Re: TK without titlebar / Chromeless TK
by strat (Canon) on Feb 07, 2006 at 09:24 UTC

    Maybe $mw->overrideredirect(1); is interesting for you... perldoc Tk::Wm

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Re: TK without titlebar / Chromeless TK
by thundergnat (Deacon) on Feb 07, 2006 at 14:20 UTC

    It sounds like overrideredirect is what you need. ( strat++ ) On a side note: back slashes are not interpolated inside single quotes, so that file won't exist.

    use Tk; use Tk::Photo; use Tk::JPEG; my $mw=new MainWindow; $mw->geometry('+200+200'); $mw->overrideredirect(1); my $image = ' R0lGODlhLAHIAIAAAAAAAP///yH5BAAAAAAALAAAAAAsAcgAAAL/jI+py+0Po5y02ouz3r +z7D4bi SJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMKpfMpvMJjUqn1Kr1is1qt9yu9wsOi8 +fksvmM TqvX7Lb7DY/L5/S6/Y7P6/f8vv8PGCg4SFhoeIiYqLjI2Oj4CBkpOUlZaXmJmam5ydnp+Q +kaKjpK Wmp6ipqqusra6voKGys7S1tre4ubq7vL2+v7CxwsPExcbHyMnKy8zNyMCADgTAYtPUZdHX +adAM3d rf3gHR598L09jlAu3i1RbtCu3U5+vsDNoL4OHh9Q734fr79vnpF3/gCiK3iwAcGDCCOke5 +jQnkBz E/v5c0jwXEF+/xHpVRyyUKIFgCQnfivJTiDHfh0VoDTIcuTJmQ5CelRi0wNKkeZaZlgZja +Y8hR+v wQyIgd9KpERdfmSKJOO9CyUbttxIAV5QjSqx3ozZNKk3pzVNPj3q45/VCVUv9mQ4NSW5oV +Atun1L l6dYtWXJ6j2C1ifGsF8FEx6s1Z3fwj4NBj5sOK9kvICf/pV7WfDjx0hP1gW7WF5cxlSLWs +5JeaBZ yIMzT667k+1D1I3Xppbp+nXsyk5ttyated5Gyx67Vtz9OTJn4Hbvinauuri60qx1G59egW +9oyo61 /zzru3k4bOTLmz+PPr369ezbu38PP778+fTr22c/+r6Q8Pp5eP/vsRRF2MEljmwQeCXggM +EJ9Zp1 +WGUH4IEjndbcjoEOCGFzxWIGVESBvThZwHOdtlwWd01nFnQSUQcDdQgN9lyzEUGmoXWiV +YihhDl xmODN8743A9GgZcjBzB1V+GPGNb44o4+UpdPX0m2FURiM842VnbEIUljcllCNqRwXX1wFJ +fKEVnl mL09qGCHPToJHD5S5sURnBym9GWXUrUZlZoJavikgXOSZuZQSzIp5jh2AnogozXexl8Rvs +1kmpFb nuZnnIoitxCcSfb4aHAMOREiidtBWV2MmIamY6ZB0shZmaumdqhFQqLp4Jp3NhpXin/yiS +Wtpl33 YJT5lKpiWS2ZytCdmNJlKCevA4YIYrEWyunpgnwae6y1aulTa3/ijktuueaei2666q7Lbr +vuvgtv vPLOS2+99t6Lb7767stvv/7+C3DAAg9McMEGH4xwwgovzHDDDj8MccQST0xxxRZfjHHGGm +/Mccce fwxyyCKPTHLJJp+Mcsoqr8xyyy6/DHPMMs9Mc80234xzzjrvzHPPPv8MdNBCX1AAADs= '; my $foto = $mw->Photo( -data => $image ); $mw->Button(-image => $foto, -command => sub{ $mw->destroy })->pack(); MainLoop;
Re: TK without titlebar / Chromeless TK
by spiritway (Vicar) on Feb 07, 2006 at 02:54 UTC

    I've never been able to get rid of the titlebar or the annoying "Tk" in the left corner. You might want to check out perlk.org, though. They may well have addressed this issue.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://528383]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-19 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found