Re: Receiving a callback on GDK window destroy

2010-01-19 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01/19/10 20:29, Tristan Schmelcher wrote:
> Actually, after debugging and looking at the code, it seems that
> gdk_window_foreign_new() first looks up if there is already a GdkWindow
> for that XID and re-uses it if so (gdk/x11/gdkwindow-x11.c:1008). So I
> don't think this approach will work. :(

You must be doing something wrong since you should get one xid per
windowed plugin instance. I've been using this method for years in both
the mplayerplug-in plugin and the gecko-mediaplayer plugin.

Take a look at either of those projects source code. I'm sure there is
something there that will help you.

Kevin
- -- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAktWjNQACgkQ6w2kMH0L1dG7vACcDZNHS0dTEbXCTHD0IesjVmeF
BCsAn3oewKsZFv/Dv6uV3vfKgR6k7iJl
=uFlq
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Receiving a callback on GDK window destroy

2010-01-19 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01/19/10 20:09, Tristan Schmelcher wrote:
> Thanks Kevin! I'm trying out your suggestion and I've got the GtkWindow
> hooking up to the foreign GdkWindow properly, but it looks like I still
> get the same X server error when trying to draw after the browser
> destroys the GtkSocket's window, and I still can't find a signal/event
> that gets dispatched when that happens. :( e.g., delete, destroy,
> reparent, unmap, and unrealize are not dispatched. Do you remember if
> there was a particular event that you listened for to handle this case?
> 

I think I am hooking see line 5982 in gui.c in gnome-mplayer

delete_signal_id =
g_signal_connect(GTK_OBJECT(window), "delete_event",
G_CALLBACK(delete_callback), NULL);


and I also have function called from the class destructor that tells my
application to quit (calls "shut()"   line 382 in plugin.ccp).

The source code to gecko-mediaplayer (the browser plugin) is here:

http://code.google.com/p/gecko-mediaplayer/source/checkout

And the source to gnome-mplayer is here

http://code.google.com/p/gnome-mplayer/source/checkout


Kevin

> On 15 January 2010 16:08, Kevin DeKorte  > wrote:
> 
> On 01/15/10 16:51, Tristan Schmelcher wrote:
>> Hello,
> 
>> I'm a novice Gtk app developer writing a plugin for Firefox and I'm
>> having trouble getting the callbacks that I need from Gtk/Gdk. The way
>> the plugin architecture works is that Firefox creates a GtkSocket and
>> my plugin gets passed its XID and creates the corresponding GtkPlug
>> (in the same process). By and large everything works, except at
>> shutdown. In some cases, Firefox happens to do a gdk_window_destroy()
>> on one of the parent windows of the GtkSocket before unloading my
>> plugin (for example, when closing a tab with the 'X'). That
>> recursively destroys everything down to the GtkSocket and also the
>> GtkPlug in _gdk_window_destroy_hierarchy(
>> ). So when I try to access the underlying X11 Window handle after this
>> I get an error from the X server and the program aborts. :(
> 
>> What I'd like to do is receive a signal from Gtk/Gdk when the
>> GdkWindow inside my GtkPlug is destroyed like this so that I can
>> cancel any further rendering actions. But I can't figure out how to
>> receive a signal when this happens! AFAICT none of the GtkPlug signals
>> or its inherited GtkWidget signals are dispatched when this happens.
> 
>> Any ideas?
> 
> Tristan,
> 
> I've had this same problem when developing
> gecko-mediaplayer/gnome-mplayer and mplayerplug-in. I was never able to
> fully use the GtkPlug interface. It just didn't work the way I needed it
> to.
> 
> What I ended up doing is creating a normal toplevel window and then
> embedding it in the window that firefox gave me..
> 
> Something like this where windowid is the xid I get from firefox.
> 
> 
> 
>window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> 
>if (windowid > 0 && embedding_disabled == FALSE) {
>gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
>GTK_WIDGET_SET_FLAGS(window, GTK_CAN_FOCUS);
>}
> 
> 
>   if (windowid != 0 && embedding_disabled == FALSE) {
>while (gtk_events_pending())
>gtk_main_iteration();
> 
>window_container = gdk_window_foreign_new(windowid);
>if (GTK_WIDGET_MAPPED(window))
>gtk_widget_unmap(window);
> 
>gdk_window_reparent(window->window, window_container, 0, 0);
>}
> 
> 
> Hope that helps.
> 
> Kevin

- -- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAktWjEkACgkQ6w2kMH0L1dH8OwCcDrnft8U+m1vH9OkklpEHQX5T
QuYAmwehrYVDxtE7Wpxdycp7mtds1ozc
=DkC7
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Receiving a callback on GDK window destroy

2010-01-19 Thread Tristan Schmelcher
Actually, after debugging and looking at the code, it seems that
gdk_window_foreign_new() first looks up if there is already a GdkWindow for
that XID and re-uses it if so (gdk/x11/gdkwindow-x11.c:1008). So I don't
think this approach will work. :(

On 19 January 2010 19:09, Tristan Schmelcher  wrote:

> Thanks Kevin! I'm trying out your suggestion and I've got the GtkWindow
> hooking up to the foreign GdkWindow properly, but it looks like I still get
> the same X server error when trying to draw after the browser destroys the
> GtkSocket's window, and I still can't find a signal/event that gets
> dispatched when that happens. :( e.g., delete, destroy, reparent, unmap, and
> unrealize are not dispatched. Do you remember if there was a particular
> event that you listened for to handle this case?
>
>
> On 15 January 2010 16:08, Kevin DeKorte  wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 01/15/10 16:51, Tristan Schmelcher wrote:
>> > Hello,
>> >
>> > I'm a novice Gtk app developer writing a plugin for Firefox and I'm
>> > having trouble getting the callbacks that I need from Gtk/Gdk. The way
>> > the plugin architecture works is that Firefox creates a GtkSocket and
>> > my plugin gets passed its XID and creates the corresponding GtkPlug
>> > (in the same process). By and large everything works, except at
>> > shutdown. In some cases, Firefox happens to do a gdk_window_destroy()
>> > on one of the parent windows of the GtkSocket before unloading my
>> > plugin (for example, when closing a tab with the 'X'). That
>> > recursively destroys everything down to the GtkSocket and also the
>> > GtkPlug in _gdk_window_destroy_hierarchy(
>> > ). So when I try to access the underlying X11 Window handle after this
>> > I get an error from the X server and the program aborts. :(
>> >
>> > What I'd like to do is receive a signal from Gtk/Gdk when the
>> > GdkWindow inside my GtkPlug is destroyed like this so that I can
>> > cancel any further rendering actions. But I can't figure out how to
>> > receive a signal when this happens! AFAICT none of the GtkPlug signals
>> > or its inherited GtkWidget signals are dispatched when this happens.
>> >
>> > Any ideas?
>>
>> Tristan,
>>
>> I've had this same problem when developing
>> gecko-mediaplayer/gnome-mplayer and mplayerplug-in. I was never able to
>> fully use the GtkPlug interface. It just didn't work the way I needed it
>> to.
>>
>> What I ended up doing is creating a normal toplevel window and then
>> embedding it in the window that firefox gave me..
>>
>> Something like this where windowid is the xid I get from firefox.
>>
>>
>>
>>window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>>
>>if (windowid > 0 && embedding_disabled == FALSE) {
>>gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
>>GTK_WIDGET_SET_FLAGS(window, GTK_CAN_FOCUS);
>>}
>>
>>
>>   if (windowid != 0 && embedding_disabled == FALSE) {
>>while (gtk_events_pending())
>>gtk_main_iteration();
>>
>>window_container = gdk_window_foreign_new(windowid);
>>if (GTK_WIDGET_MAPPED(window))
>>gtk_widget_unmap(window);
>>
>>gdk_window_reparent(window->window, window_container, 0, 0);
>>}
>>
>>
>> Hope that helps.
>>
>> Kevin
>> - --
>> Get my public GnuPG key from
>> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.10 (GNU/Linux)
>> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAktRA4AACgkQ6w2kMH0L1dFb0ACfdc7jssfzEnillFHhrUFOjDbW
>> nsQAnj4Q6GCxg8H1zeoC9/NTx8kuRtDV
>> =iMWg
>> -END PGP SIGNATURE-
>>
>
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Receiving a callback on GDK window destroy

2010-01-19 Thread Tristan Schmelcher
Thanks Kevin! I'm trying out your suggestion and I've got the GtkWindow
hooking up to the foreign GdkWindow properly, but it looks like I still get
the same X server error when trying to draw after the browser destroys the
GtkSocket's window, and I still can't find a signal/event that gets
dispatched when that happens. :( e.g., delete, destroy, reparent, unmap, and
unrealize are not dispatched. Do you remember if there was a particular
event that you listened for to handle this case?

On 15 January 2010 16:08, Kevin DeKorte  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 01/15/10 16:51, Tristan Schmelcher wrote:
> > Hello,
> >
> > I'm a novice Gtk app developer writing a plugin for Firefox and I'm
> > having trouble getting the callbacks that I need from Gtk/Gdk. The way
> > the plugin architecture works is that Firefox creates a GtkSocket and
> > my plugin gets passed its XID and creates the corresponding GtkPlug
> > (in the same process). By and large everything works, except at
> > shutdown. In some cases, Firefox happens to do a gdk_window_destroy()
> > on one of the parent windows of the GtkSocket before unloading my
> > plugin (for example, when closing a tab with the 'X'). That
> > recursively destroys everything down to the GtkSocket and also the
> > GtkPlug in _gdk_window_destroy_hierarchy(
> > ). So when I try to access the underlying X11 Window handle after this
> > I get an error from the X server and the program aborts. :(
> >
> > What I'd like to do is receive a signal from Gtk/Gdk when the
> > GdkWindow inside my GtkPlug is destroyed like this so that I can
> > cancel any further rendering actions. But I can't figure out how to
> > receive a signal when this happens! AFAICT none of the GtkPlug signals
> > or its inherited GtkWidget signals are dispatched when this happens.
> >
> > Any ideas?
>
> Tristan,
>
> I've had this same problem when developing
> gecko-mediaplayer/gnome-mplayer and mplayerplug-in. I was never able to
> fully use the GtkPlug interface. It just didn't work the way I needed it
> to.
>
> What I ended up doing is creating a normal toplevel window and then
> embedding it in the window that firefox gave me..
>
> Something like this where windowid is the xid I get from firefox.
>
>
>
>window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>
>if (windowid > 0 && embedding_disabled == FALSE) {
>gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
>GTK_WIDGET_SET_FLAGS(window, GTK_CAN_FOCUS);
>}
>
>
>   if (windowid != 0 && embedding_disabled == FALSE) {
>while (gtk_events_pending())
>gtk_main_iteration();
>
>window_container = gdk_window_foreign_new(windowid);
>if (GTK_WIDGET_MAPPED(window))
>gtk_widget_unmap(window);
>
>gdk_window_reparent(window->window, window_container, 0, 0);
>}
>
>
> Hope that helps.
>
> Kevin
> - --
> Get my public GnuPG key from
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAktRA4AACgkQ6w2kMH0L1dFb0ACfdc7jssfzEnillFHhrUFOjDbW
> nsQAnj4Q6GCxg8H1zeoC9/NTx8kuRtDV
> =iMWg
> -END PGP SIGNATURE-
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: bitmap in button doesn't appear in 64bit 9.10

2010-01-19 Thread Garth's KidStuff
okay. I want to do things the right way. It's hard sometimes because  
the documentation is a little light. *grin*


I guess I'll look into how to construct the button manually.

Garth Upshaw

On Jan 19, 2010, at 4:20 PM, David Nečas  wrote:


On Tue, Jan 19, 2010 at 10:14:28AM -0800, Garth's KidStuff wrote:
Thanks.  After some digging, I managed to find out how to set the  
settings:


   // Set button/menu images on by default -- 9.10 turned them off
   GtkSettings *settings = gtk_settings_get_default ();
   gtk_settings_set_long_property (settings, "gtk-button-images", 1,
".gtkrc:0"); // I don't understand the significance of the origin  
param.  I

just saw this on some thread and tried it -- it works...
   gtk_settings_set_long_property (settings, "gtk-menu-images", 1,
".gtkrc:0");


You can set images on menu items where they are really, really  
necessary

by setting the "always-show-image" property.

If you have buttons that make no sense without the image, you have
always the option of constructing their content manually instead of
using the "image" property.

I did both in a few cases in my programs, namely in special menus and
where the image carried the primary information and the text only
auxiliary.

By changing the settings in *code* you behave a thousand times worse
than Ubuntu did.  The GtkSettings distro defaults can be probably
changed in some user preferences; and in the worst case by gconf- 
editor

or

gconftool-2 --type boolean --set /desktop/gnome/interface/ 
menus_have_icons true


or similar means.

How will anyone using your app disable the icons in menus?

Yeti


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: bitmap in button doesn't appear in 64bit 9.10

2010-01-19 Thread David Nečas
On Tue, Jan 19, 2010 at 10:14:28AM -0800, Garth's KidStuff wrote:
> Thanks.  After some digging, I managed to find out how to set the settings:
> 
> // Set button/menu images on by default -- 9.10 turned them off
> GtkSettings *settings = gtk_settings_get_default ();
> gtk_settings_set_long_property (settings, "gtk-button-images", 1,
> ".gtkrc:0"); // I don't understand the significance of the origin param.  I
> just saw this on some thread and tried it -- it works...
> gtk_settings_set_long_property (settings, "gtk-menu-images", 1,
> ".gtkrc:0");

You can set images on menu items where they are really, really necessary
by setting the "always-show-image" property.

If you have buttons that make no sense without the image, you have
always the option of constructing their content manually instead of
using the "image" property.

I did both in a few cases in my programs, namely in special menus and
where the image carried the primary information and the text only
auxiliary.

By changing the settings in *code* you behave a thousand times worse
than Ubuntu did.  The GtkSettings distro defaults can be probably
changed in some user preferences; and in the worst case by gconf-editor
or

gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true

or similar means.

How will anyone using your app disable the icons in menus?

Yeti

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: ComboBox submenus

2010-01-19 Thread Carlos Pereira

Hi Tadej,

many thanks for responding!
I saw your bug report, will study gtk-demo to understand how this can be 
achieved


Best regards,
Carlos


Hello.

  

1) Submenus should look the same in ComboBox and Popup menus.  Therefore
Main 1 and Main 2 (see working example or tree store below) should not
appear repeated again in the submenus. Even if they were there, they should
not be selectable as they are only entry points to submenus. The workaround
I know is: when users select Main 1 or Main 2, just select a sensible
default instead, such as the first main item, the last chosen item, the
first item in the submenu.



I'm only commenting about this point, since I reported a bug[1] on
this behavior not long ago. I proposed an additional property that
would control toplevel copying, but Matthias Clasen pointed out that
this can be achieved by using cell data function as shown in gtk-demo
application.

Tadej

[1] https://bugzilla.gnome.org/show_bug.cgi?id=604868

  


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: ComboBox submenus

2010-01-19 Thread Tadej Borovšak
Hello.

> 1) Submenus should look the same in ComboBox and Popup menus.  Therefore
> Main 1 and Main 2 (see working example or tree store below) should not
> appear repeated again in the submenus. Even if they were there, they should
> not be selectable as they are only entry points to submenus. The workaround
> I know is: when users select Main 1 or Main 2, just select a sensible
> default instead, such as the first main item, the last chosen item, the
> first item in the submenu.

I'm only commenting about this point, since I reported a bug[1] on
this behavior not long ago. I proposed an additional property that
would control toplevel copying, but Matthias Clasen pointed out that
this can be achieved by using cell data function as shown in gtk-demo
application.

Tadej

[1] https://bugzilla.gnome.org/show_bug.cgi?id=604868

-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeb...@gmail.com
tadej.borov...@gmail.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: ComboBox submenus

2010-01-19 Thread Carlos Pereira
It seems the mailling list is filtering even small tar.gz files as mine, 
so I posted it here:


http://www.gamgi.org/combo.tar.gz

Regards,
Carlos
My ComboBox submenus are working fine. There are however a couple of 
visual details that could be improved, in my opinion.


I am sending as attachement a small (70 lines) working example  (C + 
makefile) showing my points:


1) Submenus should look the same in ComboBox and Popup menus.  
Therefore Main 1 and Main 2 (see working example or tree store below) 
should not appear repeated again in the submenus. Even if they were 
there, they should not be selectable as they are only entry points to 
submenus. The workaround I know is: when users select Main 1 or Main 
2, just select a sensible default instead, such as the first main 
item, the last chosen item, the first item in the submenu.


2) All pop up menus should have the same width. Currently this 
deppends entirely of the size of the label strings. The submenus for 
Main 1 and Main 2 have entirely different widths, and I think this 
looks unprofessional. The workaround I know is: add whitespaces at the 
end of the label strings.


3) The main menu has a large space between the labels and the  submenu 
arrows, I guess this is probably related with accelerators (which I am 
not using here) but it looks a bit ugly. I don't know any workaround 
for this. Pop up menus have the same issue.


I am planning to fill a bug report about this. If someone can prove me 
wrong or knows a solution for any of the three points discussed above, 
I would be glad to know.


Thanks!
Carlos

store = gtk_tree_store_new (1, G_TYPE_STRING);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 0", -1);

gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 1", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:0", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:1", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:2", -1);

gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 2", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Very very long 2:0", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Very very long 2:1", -1);



___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


ComboBox submenus

2010-01-19 Thread Carlos Pereira
My ComboBox submenus are working fine. There are however a couple of 
visual details that could be improved, in my opinion.


I am sending as attachement a small (70 lines) working example  (C + 
makefile) showing my points:


1) Submenus should look the same in ComboBox and Popup menus.  Therefore 
Main 1 and Main 2 (see working example or tree store below) should not 
appear repeated again in the submenus. Even if they were there, they 
should not be selectable as they are only entry points to submenus. The 
workaround I know is: when users select Main 1 or Main 2, just select a 
sensible default instead, such as the first main item, the last chosen 
item, the first item in the submenu.


2) All pop up menus should have the same width. Currently this deppends 
entirely of the size of the label strings. The submenus for Main 1 and 
Main 2 have entirely different widths, and I think this looks 
unprofessional. The workaround I know is: add whitespaces at the end of 
the label strings.


3) The main menu has a large space between the labels and the  submenu 
arrows, I guess this is probably related with accelerators (which I am 
not using here) but it looks a bit ugly. I don't know any workaround for 
this. Pop up menus have the same issue.


I am planning to fill a bug report about this. If someone can prove me 
wrong or knows a solution for any of the three points discussed above, I 
would be glad to know.


Thanks!
Carlos

store = gtk_tree_store_new (1, G_TYPE_STRING);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 0", -1);

gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 1", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:0", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:1", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Short 1:2", -1);

gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, "Main 2", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Very very long 2:0", -1);
gtk_tree_store_append (store, &child, &iter);
gtk_tree_store_set (store, &child, 0, "Very very long 2:1", -1);

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: bitmap in button doesn't appear in 64bit 9.10

2010-01-19 Thread Garth's KidStuff
Thanks.  After some digging, I managed to find out how to set the settings:

// Set button/menu images on by default -- 9.10 turned them off
GtkSettings *settings = gtk_settings_get_default ();
gtk_settings_set_long_property (settings, "gtk-button-images", 1,
".gtkrc:0"); // I don't understand the significance of the origin param.  I
just saw this on some thread and tried it -- it works...
gtk_settings_set_long_property (settings, "gtk-menu-images", 1,
".gtkrc:0");

Thanks, again!

-Garth

On Tue, Jan 19, 2010 at 11:35 AM, Tadej Borovšak  wrote:

> Hello.
>
> > The following code works great in 32 bit and 64bit <= 9.04, but no bitmap
> > appears when I run in 64bit 9.10.
> >
> >Gtk::Image* img = NULL;
> >if (btnImageName.length() > 0)
> >{
> >cppstring path = GUtils::OSGetIconFolder() + btnImageName +
> L".png";
> >img = new
> > Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path));
> >}
> >
> >Gtk::Button* btn = new Gtk::Button;
> >if (img != NULL)
> >{
> >btn->set_image(*img);
> >btn->set_image_position(Gtk::POS_LEFT);
> >}
> >btn->set_alignment(0.0, 0.5);
> >btn->signal_clicked().connect(sigc::bind(sigc::mem_fun(this,
> > &LXLiveReadoutManager::ToggleSourceWindow), sourceID));
> >m_ButtonMap[sourceID] = btn;
> >m_ButtonBox->add(*btn);
> >
> >m_ButtonBox->show_all();
>
> I think this is Ubuntu's "fault". They decided to reduce visual
> clutter and trim images from menu items, buttons, etc. by default.
> User can change this by setting "gtk-button-images" and
> "gtk-menu-images" GtkSettings to TRUE, but I cannot help you with GUI
> tools, since I don't use Ubuntu or GNOME.
>
> Tadej
>
>
> --
> Tadej Borovšak
> tadeboro.blogspot.com
> tadeb...@gmail.com
> tadej.borov...@gmail.com
>



-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: bitmap in button doesn't appear in 64bit 9.10

2010-01-19 Thread Tadej Borovšak
Hello.

> The following code works great in 32 bit and 64bit <= 9.04, but no bitmap
> appears when I run in 64bit 9.10.
>
>    Gtk::Image* img = NULL;
>    if (btnImageName.length() > 0)
>    {
>        cppstring path = GUtils::OSGetIconFolder() + btnImageName + L".png";
>        img = new
> Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path));
>    }
>
>    Gtk::Button* btn = new Gtk::Button;
>    if (img != NULL)
>    {
>        btn->set_image(*img);
>        btn->set_image_position(Gtk::POS_LEFT);
>    }
>    btn->set_alignment(0.0, 0.5);
>    btn->signal_clicked().connect(sigc::bind(sigc::mem_fun(this,
> &LXLiveReadoutManager::ToggleSourceWindow), sourceID));
>    m_ButtonMap[sourceID] = btn;
>    m_ButtonBox->add(*btn);
>
>    m_ButtonBox->show_all();

I think this is Ubuntu's "fault". They decided to reduce visual
clutter and trim images from menu items, buttons, etc. by default.
User can change this by setting "gtk-button-images" and
"gtk-menu-images" GtkSettings to TRUE, but I cannot help you with GUI
tools, since I don't use Ubuntu or GNOME.

Tadej


-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeb...@gmail.com
tadej.borov...@gmail.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

bitmap in button doesn't appear in 64bit 9.10

2010-01-19 Thread Garth's KidStuff
Hey, All,

The following code works great in 32 bit and 64bit <= 9.04, but no bitmap
appears when I run in 64bit 9.10.

Gtk::Image* img = NULL;
if (btnImageName.length() > 0)
{
cppstring path = GUtils::OSGetIconFolder() + btnImageName + L".png";
img = new
Gtk::Image(GTextUtils::ConvertUTF16WideStringToUTF8String(path));
}

Gtk::Button* btn = new Gtk::Button;
if (img != NULL)
{
btn->set_image(*img);
btn->set_image_position(Gtk::POS_LEFT);
}
btn->set_alignment(0.0, 0.5);
btn->signal_clicked().connect(sigc::bind(sigc::mem_fun(this,
&LXLiveReadoutManager::ToggleSourceWindow), sourceID));
m_ButtonMap[sourceID] = btn;
m_ButtonBox->add(*btn);

m_ButtonBox->show_all();

It is finding the image and making the btn->set_image call.

Thanks in advance.

-Garth
-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list