snetliner.blogg.se

Gnome image viewer
Gnome image viewer








Built for KDE4, Gwenview comes with support for virtually all image formats out there, tools to do basic editing, tree-like file browser, support for tags, thumbnail previews, cropping, image rating system, slideshow, fullscreen mode, support for plugins and two view modes (Browse and View). In my opinion this is probably the best image viewer available at the moment. Update: Two more viewers have been added, PhotoQt and Berry, increasing the number of viewers to 12. 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.This article overviews five image viewers available for Ubuntu and also includes at the end a list of another five which either are no longer maintained or are based on older libraries (KDE3 for example). 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.

gnome image viewer gnome image viewer

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.










Gnome image viewer