# GTKMozEmbed scrollbars and more questions

**URL:** <https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677>\
**Category:** Ruby-Gnome 2\
**Created:** [August 7, 2006, 11:54am UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677 "2006-08-07T11:54:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 7, 2006, 11:54am UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/1 "2006-08-07T11:54:18Z")

</div>

Hi all,

im new to ruby and ruby-gnome2 and my questions should be very basic,  
anyway, here are some questions about ruby-gnome2:

- When i use the GTKMozEmbed widget the scrollbar uses the mozilla theme  
instead of the GNOME theme, is it possible to make the GTKMozEmbed  
scrollbar to look like all GNOME scrollbars?

- Is there any way to use a spellchecker in the TextView or SourceView  
widgets? Looking to the API it seems not to be any GTKSpell widget, so i  
don’t know what would be the way to implement the spellchecker feature.

- I would like to restore the main window position and size as the last  
time the user closed the application, there’s no problem with position  
and size but i don’t know how to check if the window was maximized when  
the user closed it.

- I’m using a trayicon in my application, adding to it an EventBox with  
and image, it works nice, but the image is not resized to fit the tray.  
I’m using a .svg file format for the image.

I think this is all at the moment, i hope somebody can point me the in  
right way.

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys – and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 7, 2006, 9:01pm UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/2 "2006-08-07T21:01:10Z")

</div>

Am Montag, den 07.08.2006, 11:45 +0200 schrieb Ivan:

> Hi all,
> 
> im new to ruby and ruby-gnome2 and my questions should be very basic,  
> anyway, here are some questions about ruby-gnome2:
> 
> - When i use the GTKMozEmbed widget the scrollbar uses the mozilla theme  
> instead of the GNOME theme, is it possible to make the GTKMozEmbed  
> scrollbar to look like all GNOME scrollbars?

Don’t know…

> - Is there any way to use a spellchecker in the TextView or SourceView  
> widgets? Looking to the API it seems not to be any GTKSpell widget, so i  
> don’t know what would be the way to implement the spellchecker feature.

GtkSpell is obsolate since several years.

Several years ago i used aspell with C and it was very easy. A short  
look at [raspell download | SourceForge.net](http://sourceforge.net/projects/raspell/) the ruby aspell  
bindings shows that it is also very easy.

> - I would like to restore the main window position and size as the last  
> time the user closed the application, there’s no problem with position  
> and size but i don’t know how to check if the window was maximized when  
> the user closed it.

That is someting your windowmanager shall do via the session management.  
But i think ruby-gtk cant handle this for now.

> - I’m using a trayicon in my application, adding to it an EventBox with  
> and image, it works nice, but the image is not resized to fit the tray.  
> I’m using a .svg file format for the image.

i do this in my code:

```
  @tray = Gtk::TrayIcon.new("test")
  @traybox = Gtk::EventBox.new
  @trayimage = Gtk::Image.new
  @tray.add @traybox
  @traybox.add @trayimage
  @tooltip = Gtk::Tooltips.new
  @traysize = 0

  @tray.signal_connect("configure_event") do |widget, event|
    @traysize = event.width > event.height ? event.width :

```

event.height  
@traysize = @traysize / 2  
@traysize = 4 if @traysize \< 4  
end

```
  @tray.signal_connect("map_event") do
    pixbuf =

```

Gdk::Pixbuf.new(“#{@datadir}/pixmaps/radaubruder/radaubruder.svg”,  
@traysize, @traysize)  
@trayimage.pixbuf = pixbuf  
end

```
  @tray.show_all

```

> ruby-gnome2-devel-en mailing list  
> removed\_email\_address@domain.invalid  
> [ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 7, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/3 "2006-08-07T21:55:15Z")

</div>

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 7, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/4 "2006-08-07T22:37:17Z")

</div>

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 8, 2006, 2:16am UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/5 "2006-08-08T02:16:35Z")

</div>

> > 
> 
> finally, it works like this:  
> if w.window.state & Gdk::EventWindowState::MAXIMIZED ==  
> Gdk::EventWindowState::MAXIMIZED then p “maximized”;end  
> thanks
> 
> >

That code worked nice, thanks.

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 8, 2006, 2:28am UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/6 "2006-08-08T02:28:35Z")

</div>

> > - When i use the GTKMozEmbed widget the scrollbar uses the mozilla theme  
> > instead of the GNOME theme, is it possible to make the GTKMozEmbed  
> > scrollbar to look like all GNOME scrollbars?
> 
> Don’t know…

yeah, this is very strange as in the rubizilla sample movie the  
scrollbars look nice, but when i try the sample myself the scrollbars  
are like the default mozilla theme instead of GNOME scrollbars.

> 

thanks, i will take a look to it. Anyway, what i would like to do is  
underline spell errors when the user writes, im not sure if this is  
possible with the gtktextview or i should use some kind of pango object.

> ```
> @tray.signal_connect("configure_event") do |widget, event|
> @trayimage.pixbuf = pixbuf
> end
> 
> @tray.show_all
> 
> ```

woooaaa… now my trayicon looks very very very small!!

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://www.ruby-forum.com/u/ivan)\
**Post date:** [August 7, 2006, 10:04pm UTC](https://www.ruby-forum.com/t/gtkmozembed-scrollbars-and-more-questions/101677/7 "2006-08-07T22:04:15Z")

</div>

On Mo, 2006-08-07 at 20:57 +0200, Detlef R. wrote:

> Am Montag, den 07.08.2006, 11:45 +0200 schrieb Ivan:
> 
> > - I would like to restore the main window position and size as the last  
> > time the user closed the application, there’s no problem with position  
> > and size but i don’t know how to check if the window was maximized when  
> > the user closed it.

That’s quite easy:

-------v GdkWindow  
window.window.state & Gtk:🪟:STATE\_MAXIMIZED  
--------------^ GdkWindowState

(maybe wrong - i just don’t have ruby-gnome2 installed here, but that’s  
how it should work)

> That is someting your windowmanager shall do via the session management.  
> But i think ruby-gtk cant handle this for now.

The Gnome policy for these features is like that:

The window manager is responsible for window management, if an  
application wants to restore the window size, position and state, it  
needs to do this on its own (just because only the application developer  
knows which kinds of windows are of the same “type” - where “type” can  
be “main window”, “properties box”, “file save dialog”).

Session management is something that should be implemented by  
applications and a session manager.

Regards,  
Sven

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)
