示例#1
0
SplashScreen::SplashScreen(Gtk::Window *parent) :
	Gtk::Window(Gtk::WINDOW_POPUP),
	f_parent( parent )
{
    molib::moWCString splash_path( Common::GetFullPathnameForImage( SPLASH_IMAGE ) );

	if( splash_path != "" )
	{
		splash_path = molib::moFile::FullPath(splash_path);
		f_splash.set( splash_path.c_str() );
	}

	set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
	set_title(gettext("Turn Watcher Splashscreen"));
	set_resizable(false);
	set_decorated(false);
	set_has_frame(false);
	set_position(Gtk::WIN_POS_CENTER);
	set_transient_for(*f_parent);	// avoid having an icon in toolbar
	set_modal(true);		// the first click closes the splash no matter where
	set_keep_above();		// keep splashscreen on top of everything
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	add(f_box);

	f_box.add(f_splash);

	f_box.set_events(Gdk::BUTTON_PRESS_MASK);
	f_box.signal_button_press_event().connect(
			sigc::mem_fun(*this, &SplashScreen::on_button_press_event));

	show_all_children();
}
示例#2
0
TooltipTT::TooltipTT() : Gtk::Window(Gtk::WINDOW_POPUP)
{
	set_name("tooltip_win");

	//>set default timing
	timing = 600 ;

	int border_frame_in ;
	//> for lookn'feel don't add second frame in windows
#ifndef WIN32
	//> set label
	add(frame_out) ;
	// no border, but enable frame with shadow
	frame_out.set_border_width(0) ;
	frame_out.set_shadow_type(Gtk::SHADOW_ETCHED_OUT) ;
	frame_out.add(frame_in) ;
	border_frame_in = 3 ;
#else
	add(frame_in) ;
	border_frame_in = 0 ;
#endif
	//let border to get text with space, but no shadow
	frame_in.set_border_width(border_frame_in) ;
	frame_in.set_shadow_type(Gtk::SHADOW_NONE) ;

	//> set window
	set_border_width(0) ;
	show_all_children() ;
	set_position(Gtk::WIN_POS_MOUSE) ;
	set_has_frame(true);
	set_keep_above(false) ;
}