There is no option of showing anything beyond image size, type, file-size, folder and EXIF data. It is possible to show a small window with basic properties and EXIF data to the right of images. This toolbar, as well as all the features it had, have since been removed. GNOME Image Viewer used to have a toolbar with some useful features when it was named Eye Of Gnome. This gets real burdensome real quick if you want to browse through images in different folders or a tree of folders. This opens a file-picker where you have to choose an image file in another folder, not the folder itself, to switch to that folder. You have to click a button in the upper right corner to get a pop-out menu (it lacks a menu-bar) where you can click "open" if you want to switch to another folder. GNOME Image Viewer let's you easily browse through image files in one folder. It's fine for browsing through images in just one folder and that's all it's good for. The dialog would be hidden later anyway, as it is only a local variable and isĭestroyed (and therefore hidden) when the scope ends.Īssuming that the user did click Open, the next line loads theįile into the Gtk::Image so that it is displayed.GNOME "Image Viewer", formally known as "Eye Of Gnome", is a very basic and limited image viewer made for and only for the GNOME desktop. We hide the Open dialog because we don't need it any more. The dialog will wait for the user to choose an image when they do, n will return the value Gtk::RESPONSE_ACCEPT (it would return Gtk::RESPONSE_CANCEL if the user clicked Cancel). Glib::RefPtr is a smart pointer used here, that makes sure that the filter isĭestroyed when there is no reference to it anymore.ĭn displays the Open dialog. Finally, we set this filter to be the Open dialog's filter. A filter object is created first we then add all kinds of files supported by Gdk::Pixbuf (which includes most image formats like PNG and JPEG) to the filter. The next two lines restrict the Open dialog to only display files which can be opened by Gtk::Image. We use predefined values provided by GTKmm here, too. The second argument to the add_button() method is a value to identify The advantage of using stock names is that the button labels will already be translated into the user's language. Notice that we are using stock button names from Gtk, instead of manually typing "Cancel" or "Open". The next two lines add an Open and a Close button to the dialog. This takes the title and type of the dialog. The dialog for choosing the file is created using the The last step is to show all widgets in the window using We will define the callback in the next section. Method which tells GTKmm to call the on_open_image function when the button is clicked. This is done using the signal_clicked().connect When the button is clicked, it fires the clicked signal, which we can connect to some action. We need to define what happens when the user clicks on the button. In GTKmm this is usually not needed as it makes it much easier to have a layout that You will notice that we don't setĮxplicit sizes on the widgets. The image willĮxpand into any available space while the button will just be as big as needed. The calls to pack_start add the two widgets to the box and define their behaviour. The first lines create the widgets we want to use: a button for opening up an image, the image view widget itself and the box we will use as a container.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |