Hiding a scroll bar

Hello,

I’m writing a application where I have a textview inside a
scrolledwindow. Is it possible to hide the vertical scrollbar?

I tried scrolledwindow.set_policy(Gtk::POLICY_NEVER) but then my
textview grows as the text grows. I want that my textview to behave like
it there was a scrollbar, I just want it invisible (the user can go up
and down in text with PageUp/Down).

I also tried scrolledwindow.vscrollbar.hide, but that doesn’t do
nothing.

Regards,

André


Lamentação sem gratidão é murmuração. (Howard Hendricks)

Hi,

In [email protected]
“[ruby-gnome2-devel-en] Hiding a scroll bar” on Fri, 25 Jul 2008
10:26:43 -0300,
André Wagner [email protected] wrote:

I’m writing a application where I have a textview inside a scrolledwindow. Is it possible to hide the vertical scrollbar?

I tried scrolledwindow.set_policy(Gtk::POLICY_NEVER) but then my textview grows as the text grows. I want that my textview to behave like it there was a scrollbar, I just want it invisible (the user can go up and down in text with PageUp/Down).

I also tried scrolledwindow.vscrollbar.hide, but that doesn’t do nothing.

Use GtkWeidget#set_size_request.

scrolled_window = Gtk::ScrolledWindow.new

Ruby/GLib2 >= 0.17

scrolled_window.set_policy(:automatic, :never)

Ruby/GLib2 < 0.17

scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC,

Gtk::POLICY_NEVER)

text_view = Gtk::TextView.new
text_view.set_size_request(200, 300)

scrolled_window.add(text_view)

Thanks,

kou

Thank you very much for this info, this behavior was exactly what I was
looking for!

However… I need my text box to be resizeable. Is there any way I can
get this behavior wihtout using set_size_request on the text box?

Thank you in advance,

André

On Sat, 26 Jul 2008 12:20:05 +0900 (JST)
Kouhei S. [email protected] wrote:

I also tried scrolledwindow.vscrollbar.hide, but that doesn’t do nothing.
text_view = Gtk::TextView.new
This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


ruby-gnome2-devel-en mailing list
[email protected]
ruby-gnome2-devel-en List Signup and Options


Lamentação sem gratidão é murmuração. (Howard Hendricks)

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] Hiding a scroll bar” on Mon, 28 Jul 2008
08:23:07 -0300,
André Wagner [email protected] wrote:

However… I need my text box to be resizeable. Is there any way I can get this behavior wihtout using set_size_request on the text box?

Is it good enough that resize top level window?
Could you show your example script?

Thanks,

kou

However… I need my text box to be resizeable. Is there any way I can get this behavior wihtout using set_size_request on the text box?

Is it good enough that resize top level window?

Try to imagine a text editor such as Wordpad. If I use set_size_request
in the main textview, I won’t be able to resize my window by making it
smaller. Am I right?

André


Lamentação sem gratidão é murmuração. (Howard Hendricks)

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] Hiding a scroll bar” on Tue, 5 Aug 2008
07:34:21 -0300,
André Wagner [email protected] wrote:

However… I need my text box to be resizeable. Is there any way I can get this behavior wihtout using set_size_request on the text box?

Is it good enough that resize top level window?

Try to imagine a text editor such as Wordpad. If I use set_size_request in the main textview, I won’t be able to resize my window by making it smaller. Am I right?

What about text_view.set_size_request(0, 0)?

Could you show an example script that reproduces the
problem?

Thanks,

kou

Try to imagine a text editor such as Wordpad. If I use set_size_request in the main textview, I won’t be able to resize my window by making it smaller. Am I right?

What about text_view.set_size_request(0, 0)?

Oh, well, I just haven’t thought of that :slight_smile: I only thought of something
like text_view.set_size_request(400, 300).

Thank you very much for your direction and patience!

André


Lamentação sem gratidão é murmuração. (Howard Hendricks)