LinuxQuestions.org
Review your favorite Linux distribution.
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 12-12-2003, 02:32 PM   #1
socket9001
LQ Newbie
 
Registered: Dec 2003
Location: Israel
Distribution: Slackware
Posts: 21

Rep: Reputation: 15
GTK+ 1 modal windows


Hey,
I'm writing an XMMS plugin so I have to use GTK+ 1.x for the gui...
Anyway, I have this message box dialog which pops and alerts when some error occurs
and I dont seem to be able to make it modal..........
This is my code:

Code:
void message_box(gchar *message,gchar *title)
{
	GtkWidget *mb, *label, *button, *vbox, *hbox,*l,*r;

	mb = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	label = gtk_label_new (message);
	button = gtk_button_new_with_label(" OK ");
	l = gtk_label_new (" ");
	r = gtk_label_new (" ");
		
		
	vbox = gtk_vbox_new(FALSE, 0);
	hbox = gtk_hbox_new(FALSE, 0);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT(mb));
	gtk_window_set_title(GTK_WINDOW(mb), title);
	gtk_box_pack_start (GTK_BOX(vbox), label, FALSE,FALSE, 0);
	gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE , FALSE, 0);
	gtk_box_pack_start (GTK_BOX(hbox), l, TRUE , TRUE, 0);
	gtk_box_pack_start (GTK_BOX(hbox), button, FALSE , FALSE, 0);
	gtk_box_pack_start (GTK_BOX(hbox), r, TRUE , TRUE, 0);
	
	gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_LEFT);

	gtk_container_add (GTK_CONTAINER (mb), vbox);
	gtk_window_set_modal(GTK_WINDOW(mb), TRUE);
	gtk_widget_show_all (mb);
}
It doesnt work under XMMS, or in a dummy program I've made for testing...
Any help will be appreciated.

Thanks in advance.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Port a GTK+ app to Windows anime4christ Linux - Software 10 11-21-2005 08:28 PM
showing windows with Glade/GTK cho Programming 1 06-22-2005 04:38 PM
GTK popup windows cho Programming 2 06-21-2005 05:05 PM
Problem with Modal window in Linux davidheus Programming 1 10-21-2004 06:16 PM
GTK-GNUTELLA for Windows karlan Linux - General 0 09-07-2004 08:07 PM

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

All times are GMT -5. The time now is 08:42 AM.

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