Categories
PHP

php-gtk sample app

In my previous posts I wrote about php-gtk. Just a quick reminder: php-gtk lets you build desktop GUI applications for the GTK platform. These applications can be deployed on multiple platform without any hassle.

Here’s the source codes of a very simple “Hello, World!” application in php-gtk:

 

<?php

if (!class_exists(‘gtk’)) {

die(“Please load the php-gtk2 module in your php.inirn”);

}

 

$wnd = new GtkWindow();

$wnd->set_title(‘Hello world’);

$wnd->connect_simple(‘destroy’, array(‘gtk’, ‘main_quit’));

 

$lblHello = new GtkLabel(“Just wanted to sayrn’Hello world!'”);

$wnd->add($lblHello);

 

$wnd->show_all();

Gtk::main();

?>

 

If you go through the codes, you will get the structure very easily.

  • if (!class_exists(‘gtk’)) { die(“Please load the php-gtk2 module in your php.inirn”);}
    This line just checks if php-gtk is installed.
  • $wnd = new GtkWindow();
    Creates a new window.
  • $wnd->set_title(‘Hello world’);
    Sets the window title.
  • $wnd->connect_simple(‘destroy’, array(‘gtk’, ‘main_quit’));
    A bit complex. Connects the main_quit method of gtk with the “destroy” event of the window.
  • $lblHello = new GtkLabel(“Just wanted to sayrn’Hello world!'”);
    Creates a new label with the predefined text.
  • $wnd->add($lblHello);
    Adds the label to the main window.
  • $wnd->show_all();
    Shows all components.
  • Gtk::main();
    Starts the main loop. The application runs.

 

That was easy, wasn’t it?

Categories
Personal

Orientation Class: BBA, Khulna University

The day before, we were told that the BA discipline of Khulna University has a very “distinguished status” and there will be an exceptional orientation class staged for the new comers. I could easily imagine that it was going to be a dazzling show down that would match the shining image of the discipline without any concession.

I woke up late, at around 8 AM in the morning, had my breakfast on a hast and went out for the University. My dad picked me up on his bike halfway through the journey. When we reached the auditorium in the 2nd Academic Building, my dad was welcomed inside and I was requested to wait outside provided that they had special arrangements for us. After a while we were welcomed inside. We were welcomed with a bunch of flowers by two charming senior female students of the discipline. We took seats and the multimedia projector had a music video running on it. The video was shot probably by the senior students and it gave us some snap shots of the university life of the already BBA students at KU. It was a nice show with some great shots from the ever exciting university life along with soft rock music. We waited listening to some country music until our guests arrived. The guests took seats and the real show was unfolded. We had recitation from the holy Quran, speech from the teachers, guests and students. There was another great video which was definitely a great show off. The video has inspired me a lot. We took oath and then we were let out and asked to gather inside a room in the 1st Academic Building. We were served refreshment there.

In short that was the orientation. But the program was of about 2 hours. I feel sorry that I cannot give you every bit of details on it. The university life is gripping me with a great pressure and demanding me to spend more time for my academic courses.

After the ceremony, I completed some other procedures which were left unfinished the previous day. Then I got back home. I did enjoy today. It was a great fun and I am proud to be a grad student at KU’s BBA program.

University was extremely fun, and I’m going to miss it a lot especially the mini projector which we used to use as it was portable, we used to adjust it to our comfort and watch the ppt’s the way we wanted. You can check out these best cheap projector under 100 if you are having a hard time buying a much expensive model. One thing which still amazes me till today was that despite it being a mini projector, it still managed to showcase clear quality.

Anyways I’m finally a grad student. Now its time to accomplish other things in life.

Categories
Personal

My First Class at KU

I was supposed to reach KU within 9.30 but I reached at 9.15. I knew there would be course registration alone but ended up having “warm up” classes. Such a pleasant surprise.

It’s 29th March, 2009. As the official letter mentioned, I started for Khulna University well before time. I reached the campus at around 9.15 and headed straight way to the BA discipline in the 1st Academic Building. There was a little crowd there, chatting and roaming around aimlessly or better said, without knowing what to do. I soon joined them asking which of my classmates have already arrived. It was then, a young guy guided us into the same room we gathered into the day we got admitted. I found out quickly that this “student looking” guy was no less than a lecturer at BA discipline. I have heard rumors about KU BBA teachers being unfriendly, harsh and strictly conservative. The openness in the approach of this “Enamul Haque” surely made me believe that those rumors were in fact rumors. He made a nice introductory movement helping people know each other and breaking the ice. We were soon having fun in the class as students kept giving out their names and home districts. Soon after he has finished, we were introduced to another teacher who gave us an overview of what we needed to do if I wanted to register myself for the BBA course.

When the class was over, we spread out following the instructions given earlier. It was a long tiring day and I, along with the other freshers had to stand in ques, stand in the sun and walk long distances time to time under the typically hot summer sun. But what really marks the day special is that I attended the first class in my university life, no matter whether there was an academic air or not, it is special and it will remain forever?.

 

PS: I was supposed to post the entry yesterday but I felt so tired and sleepy that I went to sleep halfway through it, leaving behind the incomplete and unpublished post. I completed it today, 30th March and looking forward to publishing it with my another post about the orientation ceremony taking place today morning.