LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2007, 10:07 AM   #1
war2004
LQ Newbie
 
Registered: Sep 2004
Posts: 15

Rep: Reputation: 0
how to code borderless window gui


I'd like to create a GUI for playing music video in mplayer.
what I wanted to do is to start linux and automatically run the code below at startup and in borderless fullscreen window (something like in kiosk mode of firefox).

the code below runs in fullscreen but w/ border, I need your help or suggestion as as to what else is missing in the code, or is there other easier programming language I can use to accomplish my goal.

---code start -using perl/tk----
#!/usr/local/bin/perl
use Tk;

my $mw = new MainWindow; # Main Window
my $w = $mw->screenwidth;
my $h = $mw->screenheight;
$mw->geometry (join('x',$w,$h));
$mw->configure (-background=>'cyan'); #set BG to cyan
my $track = '';
my $frm_name = $mw -> Frame(-background=>'cyan') -> pack();
my $lab = $frm_name -> Label(-text=>"Enter Track #:", -font=>"arial 16 bold",-background=>'cyan') -> pack();
my $ent = $frm_name -> Entry(-textvariable => \$track, -width => 10,-font=>"arial 20 normal", -justify => 'center' ) -> pack();
$ent->focus; #set focus on the user entry
$mw -> bind('<Key-Escape>', sub { exit }); #exit when esc is pressed
#Shows a helping dialog box when F1 is pressed
$mw -> bind('<Key-F1>',sub { help(); });
my $but = $mw -> bind('<Key-Return>',sub { push_button(); }); #pressing enter
my $but = $mw -> Button(-text=>"Enter", -command =>\&push_button) -> pack();
#Text Area
my $txt = $mw -> Text(-width=>40, -height=>10) -> pack();

MainLoop;

#This function will be executed when the button is pushed
sub push_button {
my $name = $ent -> get();
#my $txt = $frm_name -> Label(-background=>'cyan') ->pack (-side=>'top',-pady=>'60');
$txt -> insert('end',"Playing Track $name \n");
system("mplayer -fs -fixed-vo vcd/$name.avi");
$track = ''; #clears/reset the track number entered
}

---code end ----
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a piece of c code that can set the terminal window tinieprotonjam Programming 2 01-27-2007 07:20 AM
Connection Between GUI and underlying code Centinul Programming 9 05-04-2006 04:23 PM
new shell window by script or code r2d2 Programming 2 12-14-2005 01:59 PM
borderless kde window theme? pyre Linux - General 1 10-26-2004 11:10 AM
GTK2 - move a borderless window??? PhilD Programming 3 03-21-2003 08:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration