# How to put the block title at the center in beamer?

In my beamer block the title always comes left alined. Is that possible to make the title of the block centered?

\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=120,height=120,scale=1.7,orientation=portrait]{beamerposter}
\usepackage{ragged2e}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{etoolbox}

\apptocmd{\frame}{\justifying}{}{}

\usebackgroundtemplate{\centering \includegraphics[width=\paperwidth, height=\paperheight]{Figure/LG_PKL.jpg}}

\newenvironment<>{varblock}[2][\textwidth]{%
\setlength{\textwidth}{#1}
\begin{actionenv}#3%
\def\insertblocktitle{#2}%
\par%
\usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}}

\usecolortheme{rose}

\begin{document}

\begin{frame}

\begin{textblock}{}(0.2,1.15)%
\begin{varblock}[35cm]{\textbf{1. Introduction}}
\justifying Space for discussion.
\end{varblock}
\end{textblock}

\end{document}

-
Please, once again, show a minimal, yet complete version of your document (including \documentclass, and all the settings relevant to this particular issue; for example, what kind of blocks are you using). – Gonzalo Medina May 13 '12 at 3:45
After your first comment, I was on the way to edit my question. Sorry. Will remember later. – Mahzabin May 13 '12 at 3:55
Thank you for providing a complete version of the code ;-) Don't forget my other suggestion: revisit your other questions and up-vote good answers and accept those which you consider solved your problem. – Gonzalo Medina May 13 '12 at 4:08

Change your definition of varblock to

\newenvironment<>{varblock}[2][\textwidth]{%
\setlength{\textwidth}{#1}
\begin{actionenv}#3%
\def\insertblocktitle{\centering#2\par}%
\par%
\usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}}

-
@Medina,Thanks a lot....... – Mahzabin May 13 '12 at 5:48
@Mahzabin: You're welcome! I apologize for being so insistent, but please review all the questions you've asked and accept those answers that solved your problems. In case of doubt, see how do you accept an answer?, – Gonzalo Medina May 13 '12 at 17:02

Actually - I found a much easier way of centering the title within a block. I have to say, I'm not sure if this is sort of hacky, but it works.

\begin{block}{\centering 1. Introduction}
...
...
\end{block}


I'm imagining it would work similarly for your varblock environment.

\begin{varblock}[35cm]{\centering \textbf{1. Introduction}}
\justifying Space for discussion.
\end{varblock}

-