GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 02, 2014 12:23 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: GTK3 scrolledwindow resize issue
PostPosted: Mon Mar 03, 2014 8:34 pm 
Offline
Familiar Face

Joined: Tue Oct 08, 2013 5:16 am
Posts: 20
I've been trying out Glade 3 and have found what I consider to be a problem with GTK3. The GTK3 scrolledwindow doesn't behave the same way as GTK2 scrolled window. If the scrollbars are not visible, the window doesn't scroll. Doesn't this defeat the whole purpose of a scrolled window?
The project I'm trying to write requires that I be able to scroll without the scrollbars being visible. It's an OCR editor, here's a screenshot to illustrate. I have two scrolled windows, each with a textview and each textview is connected to a different buffer. I load a scanned image into the buffer connected to the upper textview and the OCR result text into the lower. This is suppose to be like a 'heads up display', making it easier to edit sloppy OCR results.
I would appreciate any help you could give me on this. Personally, I think the behavior of the GTK 2 scrolled window was just fine, I wasn't having any problems with it. Like they say, "if it ain't broke, don't fix it". Thanks in advance.

I'm using:
Glade 3.16.1
GTK 3.10.6
Python 2.7.5
Python 3.3.2
Fedora 20


Attachments:
app01.png
app01.png [ 37.11 KiB | Viewed 321 times ]


Last edited by taupist on Sun Mar 16, 2014 11:20 pm, edited 2 times in total.
Top
 Profile  
 
 Post subject: Re: GTK3 scrolledwindow complaint
PostPosted: Sat Mar 08, 2014 7:44 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 750
Location: UK
Hello,

There are many changes between version 2 and version 3 of GTK. This is so that deprecated features in version 2 can be removed and long awaiting changes can be made. There major version change being the most suitable point to do this. GTK has to keep being updated otherwise it will fall behind other tool kits, standards and the move in technology.

For you the differences will be in the expand and fill flags and the scrolling changes. There is some documentation in the porting guide at https://developer.gnome.org/gtk3/stable/ch24s02.html#id-1.6.3.4.13 which can help, and check out the functions that you are using for any changes. You may want to keep the documentation for both versions handy while you port your application over to version 3.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GTK3 scrolledwindow complaint
PostPosted: Sat Mar 08, 2014 10:09 pm 
Offline
Familiar Face

Joined: Tue Oct 08, 2013 5:16 am
Posts: 20
Okay, I changed the Resize mode from "Parent" to "Queue".
Thanks for your help.


Top
 Profile  
 
 Post subject: Re: [Solved] GTK3 scrolledwindow complaint
PostPosted: Sun Mar 16, 2014 11:19 pm 
Offline
Familiar Face

Joined: Tue Oct 08, 2013 5:16 am
Posts: 20
Okay, I put a fixed widget as parent to each scrolled window.
This is how it is suppose to look;
Image

Normally the OCR editor is hidden, I only show it when I need it.
The problem is that if I load the text buffer before I show the OCR editor the textview expands.
Like this;
Image

I've tried everything I can find on the Internet, but nothing seems to work.
Here's some of my code;
Code:
        # OCR editor
        self.ocrgrid = self.builder.get_object("ocrgrid")
        #self.imgfixed = self.builder.get_object("imgfixed")
        #self.imgfixed.set_vexpand(False)
        self.ocrfixed = self.builder.get_object("ocrfixed")
        #self.ocrfixed.set_vexpand(False)
        #print(self.ocrfixed.compute_expand(Gtk.Orientation.VERTICAL))
        self.imgview = self.builder.get_object("imgview")
        #self.imgview.set_vexpand(False)
        self.ocrview = self.builder.get_object("ocrview")
        #self.ocrview.set_vexpand(False)
        #print(self.ocrview.compute_expand(Gtk.Orientation.VERTICAL))
        self.ocrscrolladjust = self.builder.get_object("ocrscrolladjust")
        self.imgscrolladjust = self.builder.get_object("imgscrolladjust")
        self.scaleadjust = self.builder.get_object("scaleadjust")
        self.imgscroll = self.builder.get_object("imgscroll")
        self.ocrscroll = self.builder.get_object("ocrscroll")
        #self.ocrscroll.set_vexpand(False)
        #print(self.ocrscroll.compute_expand(Gtk.Orientation.VERTICAL))
        #print(self.ocrscroll.compute_expand(Gtk.Orientation.HORIZONTAL))


Attachments:
app-gtk3-fail.png
app-gtk3-fail.png [ 14.19 KiB | Viewed 276 times ]
app-gtk3-right.png
app-gtk3-right.png [ 33.85 KiB | Viewed 276 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group